class Qpid::Proton::Endpoint
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}"
Constants
- LOCAL_ACTIVE
The local connection is active.
- LOCAL_CLOSED
The local connection is closed.
- LOCAL_MASK
Bitmask for the local-only flags.
- LOCAL_UNINIT
The local connection is uninitialized.
- REMOTE_ACTIVE
The remote connection is active.
- REMOTE_CLOSED
The remote connection is closed.
- REMOTE_MASK
Bitmask for the remote-only flags.
- REMOTE_UNINIT
The remote connection is unitialized.
Public Instance Methods
@private @return [Bool] true if {#state} has all the bits of `mask` set
# File lib/core/endpoint.rb, line 75 def check_state(mask) (self.state & mask) == mask; end
@return [Bool] true if endpoint has sent and received a CLOSE frame
# File lib/core/endpoint.rb, line 78 def closed?() check_state(LOCAL_CLOSED | REMOTE_CLOSED); end
@private
# File lib/core/endpoint.rb, line 56 def condition; remote_condition || local_condition; end
# File lib/core/endpoint.rb, line 91 def local_closed? check_state(LOCAL_CLOSED) end
@private
# File lib/core/endpoint.rb, line 60 def local_condition; Condition.convert(_local_condition); end
# File lib/core/endpoint.rb, line 87 def local_open? check_state(LOCAL_ACTIVE) end
# File lib/core/endpoint.rb, line 83 def local_uninit? check_state(LOCAL_UNINIT) end
@return [Bool] true if endpoint has sent and received an OPEN frame
# File lib/core/endpoint.rb, line 81 def open?() check_state(LOCAL_ACTIVE | REMOTE_ACTIVE); end
# File lib/core/endpoint.rb, line 103 def remote_closed? check_state(REMOTE_CLOSED) end
@private
# File lib/core/endpoint.rb, line 58 def remote_condition; Condition.convert(_remote_condition); end
# File lib/core/endpoint.rb, line 99 def remote_open? check_state(REMOTE_ACTIVE) end
# File lib/core/endpoint.rb, line 95 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 66 def transport self.connection.transport end
@return [WorkQueue] the work queue for work on this endpoint.
# File lib/core/endpoint.rb, line 71 def work_queue() connection.work_queue; end