getSSLHost($host); parent::__construct($ssl_host, $port); $this->context_ = $context; } public function getSSLHost($host) { $transport_protocol_loc = strpos($host, "://"); if ($transport_protocol_loc === false) { $host = 'ssl://' . $host; } return $host; } /** * Opens a new socket server handle * * @return void */ public function listen() { $this->listener_ = @stream_socket_server( $this->host_ . ':' . $this->port_, $errno, $errstr, STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $this->context_ ); } /** * Implementation of accept. If not client is accepted in the given time * * @return TSocket */ protected function acceptImpl() { $handle = @stream_socket_accept($this->listener_, $this->acceptTimeout_ / 1000.0); if (!$handle) { return null; } $socket = new TSSLSocket(); $socket->setHandle($handle); return $socket; } }