NetClient

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

Methods

__construct

__construct() 

Close the client.

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.

Open a connection to a server at the specific <code>remoteAddress</code>.

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 connectHandler instance

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 remoteAddress.

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 $serverName [string] the SNI server name param $connectHandler [callable] connect($remoteAddress, $serverName, $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 \io\vertx\jphp\core\net\NetSocket

instance is supplied via the connectHandler instance

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)

Arguments

$arg0

integer | SocketAddress

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

$this

a reference to this, so the API can be used fluently

Whether the metrics are enabled for this measured object

isMetricsEnabled() : boolean

Response

boolean

{@code true} if metrics are enabled