Devristo\Phpws\Server\WebSocketServer::__construct PHP Method

__construct() public method

Must be implemented by all extending classes
public __construct ( $url, React\EventLoop\LoopInterface $loop, Zend\Log\LoggerInterface $logger )
$url
$loop React\EventLoop\LoopInterface
$logger Zend\Log\LoggerInterface
    public function __construct($url, LoopInterface $loop, LoggerInterface $logger)
    {
        $uri = new Uri($url);
        if ($uri->getScheme() == 'ws') {
            $uri->setScheme('tcp');
        } elseif ($uri->getScheme() == 'wss') {
            $uri->setScheme('ssl');
        }
        if ($uri->getScheme() != 'tcp' && $uri->getScheme() != 'ssl') {
            throw new \InvalidArgumentException("Uri scheme must be one of: tcp, ssl, ws, wss");
        }
        $this->uri = $uri;
        $this->loop = $loop;
        $this->_streams = new SplObjectStorage();
        $this->_connections = new SplObjectStorage();
        $this->_context = stream_context_create();
        $this->_logger = $logger;
    }