A TCP client.
Multiple connections to different servers can be made using the same instance.
This client supports a configurable number of connection attempts and a configurable delay between attempts.
package |
Default |
---|
__construct()
close() : void
Any sockets which have not been closed manually will be closed here. The close is asynchronous and may not complete until some time after the method has returned.
connect( $arg0, $arg1, $arg2 = null, $arg3 = null) : $this
The connect is done asynchronously and on success, a @see \io\vertx\jphp\core\net\NetSocket instance is supplied via the connectHandler
instance
param $remoteAddress [SocketAddress] the remote address
param $connectHandler [callable]
connect($remoteAddress, $connectHandler)
Open a connection to a server at the specific port
and host
.
host
can be a valid host name or IP address. The connect is done asynchronously and on success, a
see |
\io\vertx\jphp\core\net\NetSocket
instance is supplied via the param $port [integer] the port param $host [string] the host param $connectHandler [callable] connect($port, $host, $connectHandler) Open a connection to a server at the specific
The connect is done asynchronously and on success, a @see \io\vertx\jphp\core\net\NetSocket instance is supplied via the
instance is supplied via the param $port [integer] the port param $host [string] the host param $serverName [string] the SNI server name param $connectHandler [callable] connect($port, $host, $serverName, $connectHandler) |
---|
integer | SocketAddress
callable | string
callable | string
callable
$this
a reference to this, so the API can be used fluently
isMetricsEnabled() : boolean
boolean
{@code true} if metrics are enabled