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 Class Methods

new(io, handler, container) click to toggle source
# File lib/core/listener.rb, line 83
def initialize(io, handler, container)
  @io, @handler = io, handler
  @container = container
end

Public Instance Methods

close(error=nil) click to toggle source

Close the listener @param error [Condition] Optional error condition.

# File lib/core/listener.rb, line 68
def close(error=nil)
  @closing = true
  @condition ||= Condition.convert error
  @io.close_read rescue nil # Cause listener to wake out of IO.select
  nil
end
port() click to toggle source

Get the IP port used by the listener

# File lib/core/listener.rb, line 79
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 76
def to_io() @io; end