class Qpid::Proton::Listener

A listener for incoming connections.

Create with {Container#listen} or {Container#listen_io}. To control the handler and connection options applied to incoming connections, pass a {ListenerHandler} on creation.

Attributes

condition[R]

@return [Condition] The error condition if there is one

container[R]

@return [Container] The listener's container

Public Instance Methods

close(error=nil) click to toggle source

Initiate closing the the listener. It will not be fully {#closed?} until its {Handler#on_close} is called by the {Container} @param error [Condition] Optional error condition.

# File lib/core/listener.rb, line 69
def close(error=nil)
  return if closed? || @closing
  @closing = true
  @condition ||= Condition.convert error
  @io.close_read rescue nil # Force Container IO.select to wake with listener readable.
  nil
end
closed?() click to toggle source

True if the listening socket is fully closed

# File lib/core/listener.rb, line 84
def closed?() @io.closed?; end
port() click to toggle source

Get the IP port used by the listener

# File lib/core/listener.rb, line 81
def port() to_io.addr[1]; end
to_io() click to toggle source

Get the {IO} server socket used by the listener

# File lib/core/listener.rb, line 78
def to_io() @io; end