class Qpid::Proton::Listener::Handler
Class that handles listener events and provides options for accepted connections. This class simply returns a fixed set of options for every connection accepted, but you can subclass and override all of the on_ methods to provide more interesting behaviour.
Note: If a {Listener} method raises an exception, it will stop the {Container} that the handler is running in. See {Container#run}
Public Class Methods
@param opts [Hash] Options to return from on_accept.
# File lib/core/listener.rb, line 37 def initialize(opts=nil) @opts = opts || {}; end
Public Instance Methods
Called when a listener accepts a new connection. @param listener [Listener] The listener @return [Hash] Options to apply to the incoming connection, see {#connect}
# File lib/core/listener.rb, line 53 def on_accept(listener) @opts; end
Called when the listener closes. @param listener [Listener] The listener accepting the connection.
# File lib/core/listener.rb, line 57 def on_close(listener) end
Called if an error occurs. If there is an error while opening the listener, this method is called and {#on_open} is not @param listener [Listener] @param what [Condition] Information about the error.
# File lib/core/listener.rb, line 48 def on_error(listener, what) end
Called when the listener is ready to accept connections. @param listener [Listener] The listener
# File lib/core/listener.rb, line 41 def on_open(listener) end