Kraken\Network\Socket\SocketServer::__construct PHP Method

__construct() public method

public __construct ( Kraken\Ipc\Socket\SocketListenerInterface $socket, Kraken\Network\NetworkComponentInterface $component = null )
$socket Kraken\Ipc\Socket\SocketListenerInterface
$component Kraken\Network\NetworkComponentInterface
    public function __construct(SocketListenerInterface $socket, NetworkComponentInterface $component = null)
    {
        $this->socket = $socket;
        $this->component = $component === null ? new NullServer() : $component;
        $socket->on('connect', [$this, 'handleConnect']);
    }