HH\Lib\TCP\connect_async
Requires the Hack Standard Library - Experimental Additions to be installed.
Facebook Engineer?
This function is available as TCP\gen_connect()
in Facebook's www repository.
Connect to a socket asynchronously, returning a disposable handle
namespace HH\Lib\TCP;
function connect_async(
string $host,
int $port,
ConnectOptions $opts = array (
),
): Awaitable<DisposableSocket>;
If using IPv6 with a fallback to IPv4 with a connection timeout, the timeout will apply separately to the IPv4 and IPv6 connection attempts.
Parameters
string $host
int $port
ConnectOptions $opts = array ( )