Backend to act as a TCP socket server.
Address and port on which the server is listening for connections.
Address and port on which the server is listening for connections.
# File lib/thin/backends/tcp_server.rb, line 8 def initialize(host, port) @host = host @port = port super() end
Connect the server
# File lib/thin/backends/tcp_server.rb, line 15 def connect @signature = EventMachine.start_server(@host, @port, Connection, &method(:initialize_connection)) end
Stops the server
# File lib/thin/backends/tcp_server.rb, line 20 def disconnect EventMachine.stop_server(@signature) end
# File lib/thin/backends/tcp_server.rb, line 24 def to_s "#{@host}:#{@port}" end