Class: Qpid::Proton::Listener

Inherits:
Object
  • Object
show all
Defined in:
lib/core/listener.rb

Overview

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.

Direct Known Subclasses

Container::ListenTask

Defined Under Namespace

Classes: Handler

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#conditionCondition (readonly)

Returns The error condition if there is one.

Returns:

  • (Condition)

    The error condition if there is one



61
62
63
# File 'lib/core/listener.rb', line 61

def condition
  @condition
end

#containerContainer (readonly)

Returns The listener’s container.

Returns:



58
59
60
# File 'lib/core/listener.rb', line 58

def container
  @container
end

Instance Method Details

#close(error = nil) ⇒ Object

Close the listener

Parameters:

  • error (Condition) (defaults to: nil)

    Optional error condition.



65
66
67
68
69
70
# File 'lib/core/listener.rb', line 65

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

#to_ioObject

Get the IO server socket used by the listener



73
# File 'lib/core/listener.rb', line 73

def to_io() @io; end