TCP server class. Listens on the specified host and port and creates new connection objects of the given class. This is the most common server class. Note that the new connection objects will be bound by default to the same event loop that the server is attached to. Optionally, it can also take any existing core TCPServer object as host and create a Coolio::TCPServer out of it.
# File lib/cool.io/server.rb, line 52 def initialize(host, port = nil, klass = TCPSocket, *args, &block) listen_socket = if ::TCPServer === host host else raise ArgumentError, "port must be an integer" if nil == port ::TCPServer.new(host, port) end listen_socket.instance_eval { listen(1024) } # Change listen backlog to 1024 super(listen_socket, klass, *args, &block) end
Generated with the Darkfish Rdoc Generator 2.