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
check_state(mask)
click to toggle source
@private @return [Bool] true if {#state} has all the bits of `mask` set
# File lib/core/endpoint.rb, line 72 def check_state(mask) (self.state & mask) == mask; end
closed?()
click to toggle source
@return [Bool] true if endpoint has sent and received a CLOSE frame
# File lib/core/endpoint.rb, line 75 def closed?() check_state(LOCAL_CLOSED | REMOTE_CLOSED); end
condition()
click to toggle source
@private
# File lib/core/endpoint.rb, line 56 def condition; remote_condition || local_condition; end
local_closed?()
click to toggle source
# File lib/core/endpoint.rb, line 88 def local_closed? check_state(LOCAL_CLOSED) end
local_condition()
click to toggle source
@private
# File lib/core/endpoint.rb, line 60 def local_condition; Condition.convert(_local_condition); end
local_open?()
click to toggle source
# File lib/core/endpoint.rb, line 84 def local_open? check_state(LOCAL_ACTIVE) end
Also aliased as: local_active?
local_uninit?()
click to toggle source
# File lib/core/endpoint.rb, line 80 def local_uninit? check_state(LOCAL_UNINIT) end
open?()
click to toggle source
@return [Bool] true if endpoint has sent and received an OPEN frame
# File lib/core/endpoint.rb, line 78 def open?() check_state(LOCAL_ACTIVE | REMOTE_ACTIVE); end
remote_closed?()
click to toggle source
# File lib/core/endpoint.rb, line 100 def remote_closed? check_state(REMOTE_CLOSED) end
remote_condition()
click to toggle source
@private
# File lib/core/endpoint.rb, line 58 def remote_condition; Condition.convert(_remote_condition); end
remote_open?()
click to toggle source
# File lib/core/endpoint.rb, line 96 def remote_open? check_state(REMOTE_ACTIVE) end
Also aliased as: remote_active?
remote_uninit?()
click to toggle source
# File lib/core/endpoint.rb, line 92 def remote_uninit? check_state(REMOTE_UNINIT) end
transport()
click to toggle source
Return the transport associated with this endpoint.
@return [Transport] The transport.
# File lib/core/endpoint.rb, line 66 def transport self.connection.transport end