Class: ServerSide::HTTP::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/serverside/server.rb

Overview

The ServerSide HTTP server is designed to be fast and simple. It is also designed to support both HTTP 1.1 persistent connections, and HTTP streaming for applications which use Comet techniques.

Instance Method Summary collapse

Constructor Details

#initialize(host, port, request_class) ⇒ Server

Creates a new server by opening a listening socket and starting an accept loop. When a new connection is accepted, a new instance of the supplied connection class is instantiated and passed the connection for processing.



13
14
15
16
# File 'lib/serverside/server.rb', line 13

def initialize(host, port, request_class)
  @server = TCPServer.new(host, port)
  loop {Connection.new(@server.accept, request_class)}
end