lib/sensu/server/socket.rb
# Determine if the connection and data transmission was
# successful and call the appropriate callback, `@on_success`
# or `@on_error`, providing it with a message. Cancel the
# connection timeout timer `@timeout_timer`, if it is set. The
# `@connected_at` timestamp indicates that the connection was
# successful. If `@timed_out` is true, the connection was closed
# by the connection timeout, and the data is assumed to not have
# been transmitted.
Determine if the connection and data transmission was
successful and call the appropriate callback, `@on_success`
or `@on_error`, providing it with a message. Cancel the
connection timeout timer `@timeout_timer`, if it is set. The
`@connected_at` timestamp indicates that the connection was
successful. If `@timed_out` is true, the connection was closed
by the connection timeout, and the data is assumed to not have
been transmitted.
Determine if the connection and data transmission was successful and call the appropriate callback ` @on_success ` or ` @on_error ` providing it with a message . Cancel the connection timeout timer ` @timeout_timer ` if it is set . The ` @connected_at ` timestamp indicates that the connection was successful . If ` @timed_out ` is true the connection was closed by the connection timeout and the data is assumed to not have been transmitted .
def unbind
        @timeout_timer.cancel if @timeout_timer
        if @connected_at
          if @timed_out
            @on_error.call("socket timeout")
          else
            @on_success.call("wrote to socket")
          end
        else
          @on_error.call("failed to connect to socket")
        end
      end
def unbind @timeout_timer . cancel if @timeout_timer if @connected_at if @timed_out @on_error . call ( "socket timeout" ) else @on_success . call ( "wrote to socket" ) end else @on_error . call ( "failed to connect to socket" ) end end
Determine if the connection and data transmission was
successful and call the appropriate callback, `@on_success`
or `@on_error`, providing it with a message.
Determine if the connection and data transmission was successful and call the appropriate callback ` @on_success ` or ` @on_error ` providing it with a message .