Class: Rev::TCPServer
- Defined in:
- lib/rev/server.rb
Instance Method Summary collapse
-
#initialize(host, port, klass = TCPSocket, *args, &block) ⇒ TCPServer
constructor
A new instance of TCPServer.
Methods inherited from Listener
Methods inherited from IOWatcher
#attach, #detach, #disable, #enable, #on_readable, #on_writable
Methods inherited from Watcher
#attach, #attached?, #detach, #disable, #enable, event_callback, #evloop, watcher_delegate
Constructor Details
#initialize(host, port, klass = TCPSocket, *args, &block) ⇒ TCPServer
Returns a new instance of TCPServer.
41 42 43 44 45 |
# File 'lib/rev/server.rb', line 41 def initialize(host, port, klass = TCPSocket, *args, &block) listen_socket = ::TCPServer.new(host, port) listen_socket.instance_eval { listen(1024) } # Change listen backlog to 1024 super(listen_socket, klass, *args, &block) end |