def call
      @server = TCPServer.new('localhost', @listen_port)

      until @server.closed?
        in_socket = @server.accept
        connection = @connection_factory.call(in_socket)

        broadcast(:new_connection, connection)

        @connections.push(connection)

        connection.call # spawns a new thread that handles proxying

        reap_connections
        while @connections.size >= @max_connections
          sleep 1
          reap_connections
        end
      end
    ensure
      close
    end
def call
      @server = TCPServer.new('localhost', @listen_port)

      until @server.closed?
        in_socket = @server.accept
        connection = @connection_factory.call(in_socket)

        broadcast(:new_connection, connection)

        @connections.push(connection)

        connection.call # spawns a new thread that handles proxying

        reap_connections
        while @connections.size >= @max_connections
          sleep 1
          reap_connections
        end
      end
    ensure
      close
    end
Public: Initialize a Server

 listen_port        - The String or Integer of the port to listen to for
                      incoming connections
 connection_factory - Implements #call(in_socket) and returns a
                      Proxi::Connection
 max_connections    - The maximum amount of parallel connections to handle
                      at once
 Public: Start the server

 Start accepting and forwarding requests