Phergie\Irc\Client\React\Client::addSecureConnection PHP Method

addSecureConnection() protected method

Initializes a secured connection.
protected addSecureConnection ( Phergie\Irc\ConnectionInterface $connection )
$connection Phergie\Irc\ConnectionInterface
    protected function addSecureConnection(ConnectionInterface $connection)
    {
        // @see https://github.com/reactphp/socket-client/issues/4
        if ($this->getForceIpv4Flag($connection)) {
            throw new Exception('Using the SSL transport and IPv4 together is not currently supported', Exception::ERR_CONNECTION_STATE_UNSUPPORTED);
        }
        $hostname = $connection->getServerHostname();
        $port = $connection->getServerPort();
        $this->getSecureConnector()->create($hostname, $port)->then(function (DuplexStreamInterface $stream) use($connection) {
            $this->initializeStream($stream, $connection);
            $this->emit('connect.after.each', array($connection, $connection->getOption('write')));
        });
    }