public static function createPair($domain, $type, $protocol)
    {
        $array = [];
        $return = @socket_create_pair($domain, $type, $protocol, $array);

        if ($return === false) {
            throw new SocketException();
        }

        $sockets = self::constructFromResources($array);

        foreach ($sockets as $socket) {
            $socket->domain = $domain;
            $socket->type = $type;
            $socket->protocol = $protocol;
        }

        return $sockets;
    }
public static function createPair($domain, $type, $protocol)
    {
        $array = [];
        $return = @socket_create_pair($domain, $type, $protocol, $array);

        if ($return === false) {
            throw new SocketException();
        }

        $sockets = self::constructFromResources($array);

        foreach ($sockets as $socket) {
            $socket->domain = $domain;
            $socket->type = $type;
            $socket->protocol = $protocol;
        }

        return $sockets;
    }
public static function createPair ( $ domain , $ type , $ protocol ) { $ array = [ ] ; $ return = @ socket_create_pair ( $ domain , $ type , $ protocol , $ array ) ; if ( $ return === false ) { throw new SocketException ( ) ; } $ sockets = self :: constructFromResources ( $ array ) ; foreach ( $ sockets as $ socket ) { $ socket -> domain = $ domain ; $ socket -> type = $ type ; $ socket -> protocol = $ protocol ; } return $ sockets ; }
Creates a pair of indistinguishable sockets and stores them in an array.

<p>Creates two connected and indistinguishable sockets. This function is commonly used in IPC (InterProcess
Communication).</p>

@param int $domain   <p>The domain parameter specifies the protocol family to be used by the socket. See
<code>create()</code> for the full list.</p>
@param int $type     <p>The type parameter selects the type of communication to be used by the socket. See
<code>create()</code> for the full list.</p>
@param int $protocol <p>The protocol parameter sets the specific protocol within the specified domain to be used
when communicating on the returned socket. The proper value can be retrieved by name by using
<code>getprotobyname()</code>. If the desired protocol is TCP, or UDP the corresponding constants
<code>SOL_TCP</code>, and <code>SOL_UDP</code> can also be used. See <code>create()</code> for the full list of
supported protocols.

@throws Exception\SocketException If the creation of the php sockets is not successful.

@see Socket::create()

@return Socket[] An array of Socket objects containing identical sockets.
Creates a pair of indistinguishable sockets and stores them in an array .