Class: Rev::TCPListener
- Defined in:
- lib/rev/listener.rb
Constant Summary collapse
- DEFAULT_BACKLOG =
1024
Instance Method Summary collapse
-
#initialize(addr, port, options = {}) ⇒ TCPListener
constructor
Create a new Rev::TCPListener on the specified address and port.
Methods inherited from Listener
Methods inherited from IOWatcher
#attach, #detach, #disable, #enable, #on_readable, #on_writable
Methods included from Meta
#event_callback, #watcher_delegate
Methods inherited from Watcher
#attach, #attached?, #detach, #disable, #enable, #enabled?, #evloop
Constructor Details
#initialize(addr, port, options = {}) ⇒ TCPListener
Create a new Rev::TCPListener on the specified address and port. Accepts the following options:
:backlog - Max size of the pending connection queue (default 1024)
:reverse_lookup - Retain BasicSocket's reverse DNS functionality (default false)
52 53 54 55 56 57 58 59 |
# File 'lib/rev/listener.rb', line 52 def initialize(addr, port, = {}) BasicSocket.do_not_reverse_lookup = true unless [:reverse_lookup] [:backlog] ||= DEFAULT_BACKLOG listen_socket = ::TCPServer.new(addr, port) listen_socket.instance_eval { listen([:backlog]) } super(listen_socket) end |