protected function createSocket($type, $mode, $dsn = null, $options = array())
    {
        $context = $this->getContext();
        $socket = new Socket($context, $type);

        $options = $this->options + $options;
        foreach ($options as $key => $value) {
            $socket->setSockOpt($key, $value);
        }

        $this->connect($socket, $mode, $dsn);

        return $socket;
    }
protected function createSocket($type, $mode, $dsn = null, $options = array())
    {
        $context = $this->getContext();
        $socket = new Socket($context, $type);

        $options = $this->options + $options;
        foreach ($options as $key => $value) {
            $socket->setSockOpt($key, $value);
        }

        $this->connect($socket, $mode, $dsn);

        return $socket;
    }
protected function createSocket ( $ type , $ mode , $ dsn = null , $ options = array ( ) ) { $ context = $ this -> getContext ( ) ; $ socket = new Socket ( $ context , $ type ) ; $ options = $ this -> options + $ options ; foreach ( $ options as $ key => $ value ) { $ socket -> setSockOpt ( $ key , $ value ) ; } $ this -> connect ( $ socket , $ mode , $ dsn ) ; return $ socket ; }
Creates a socket.

@param int    $type
@param string $mode
@param string $dsn
@param array  $options

@return Socket
Creates a socket .