Class UnixConnector
Unix domain socket connector
Unix domain sockets use atomic operations, so we can as well emulate async
behavior.
-
React\Socket\UnixConnector
implements
React\Socket\ConnectorInterface
Methods summary
public
|
|
public
React\Promise\PromiseInterface
|
#
connect( string $path )
Creates a streaming connection to the given remote address
Creates a streaming connection to the given remote address
If returns a Promise which either fulfills with a stream implementing
ConnectionInterface on success or rejects with an
Exception if the connection is not successful.
`php $connector->connect('google.com:443')->then( function
(ConnectionInterface $connection) { // connection successfully established },
function (Exception $error) { // failed to connect due to $error } );
`
The returned Promise MUST be implemented in such a way that it can be
cancelled when it is still pending. Cancelling a pending promise MUST reject its
value with an Exception. It SHOULD clean up any underlying resources and
references as applicable.
`php $promise = $connector->connect($uri);
$promise->cancel(); `
Parameters
Returns
React\Promise\PromiseInterface resolves with a stream implementing ConnectionInterface on success or rejects
with an Exception on error
See
Implementation of
|