Endpoint is the parent classes for Link and Session.
It provides a namespace for constant values that relate to the current state of both links and sessions.
@example
conn = Qpid::Proton::Connection.new puts "Local connection flags : #{conn.state || Qpid::Proton::Endpoint::LOCAL_MASK}" puts "Remote connection flags: #{conn.state || Qpid::Proton::Endpoint::REMOTE_MASK}"
The local connection is active.
The local connection is closed.
Bitmask for the local-only flags.
The local connection is uninitialized.
The remote connection is active.
The remote connection is closed.
Bitmask for the remote-only flags.
The remote connection is unitialized.
@private
# File lib/core/endpoint.rb, line 63 def initialize @condition = nil end
@private
# File lib/core/endpoint.rb, line 68 def _update_condition object_to_condition(@condition, self._local_condition) end
# File lib/core/endpoint.rb, line 109 def check_state(state_mask) !(self.state & state_mask).zero? end
# File lib/core/endpoint.rb, line 113 def handler reactor = Qpid::Proton::Reactor::Reactor.wrap(Cproton.pn_object_reactor(@impl)) if reactor.nil? on_error = nil else on_error = reactor.method(:on_error) end record = self.attachments puts "record=#{record}" WrappedHandler.wrap(Cproton.pn_record_get_handler(record), on_error) end
# File lib/core/endpoint.rb, line 125 def handler=(handler) reactor = Qpid::Proton::Reactor::Reactor.wrap(Cproton.pn_object_reactor(@impl)) if reactor.nil? on_error = nil else on_error = reactor.method(:on_error) end impl = chandler(handler, on_error) record = self.attachments Cproton.pn_record_set_handler(record, impl) Cproton.pn_decref(impl) end
# File lib/core/endpoint.rb, line 89 def local_active? check_state(LOCAL_ACTIVE) end
# File lib/core/endpoint.rb, line 93 def local_closed? check_state(LOCAL_CLOSED) end
# File lib/core/endpoint.rb, line 85 def local_uninit? check_state(LOCAL_UNINIT) end
# File lib/core/endpoint.rb, line 101 def remote_active? check_state(REMOTE_ACTIVE) end
# File lib/core/endpoint.rb, line 105 def remote_closed? check_state(REMOTE_CLOSED) end
@private
# File lib/core/endpoint.rb, line 73 def remote_condition condition_to_object(self._remote_condition) end
# File lib/core/endpoint.rb, line 97 def remote_uninit? check_state(REMOTE_UNINIT) end
Return the transport associated with this endpoint.
@return [Transport] The transport.
# File lib/core/endpoint.rb, line 81 def transport self.connection.transport end