NetServer

Represents a TCP server

package

Default

Methods

__construct

__construct() 

The actual port the server is listening on. This is useful if you bound the server specifying 0 as port number signifying an ephemeral port

actualPort() : integer

Response

integer

the actual port the server is listening on.

Like @see \io\vertx\jphp\core\net\NetServer::close but supplying a handler that will be notified when close is complete.

close( $arg0) : void

Arguments

$arg0

callable

Supply a connect handler for this server. The server can only have at most one connect handler at any one time.

connectHandler( $arg0) : \io\vertx\jphp\core\net\NetServer

As the server accepts TCP or SSL connections it creates an instance of @see \io\vertx\jphp\core\net\NetSocket and passes it to the connect handler.

Arguments

$arg0

callable

Response

\io\vertx\jphp\core\net\NetServer

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

Return the connect stream for this server. The server can only have at most one handler at any one time.

connectStream() : \io\vertx\jphp\core\net\ReadStream<NetSocket>

As the server accepts TCP or SSL connections it creates an instance of @see \io\vertx\jphp\core\net\NetSocket and passes it to the connect stream .

Response

\io\vertx\jphp\core\net\ReadStream

the connect stream

Whether the metrics are enabled for this measured object

isMetricsEnabled() : boolean

Response

boolean

{@code true} if metrics are enabled

Like @see \io\vertx\jphp\core\net\NetServer::listen but providing a handler that will be notified when the server is listening, or fails.

listen( $arg0,  $arg1 = null,  $arg2 = null) : $this

param $listenHandler [callable] handler that will be notified when listening or failed listen($listenHandler)

Like @see \io\vertx\jphp\core\net\NetServer::listen but providing a handler that will be notified when the server is listening, or fails.

param $port [integer] the port to listen on param $listenHandler [callable] handler that will be notified when listening or failed listen($port, $listenHandler)

Like @see \io\vertx\jphp\core\net\NetServer::listen but providing a handler that will be notified when the server is listening, or fails.

param $localAddress [SocketAddress] the local address to listen on param $listenHandler [callable] handler that will be notified when listening or failed listen($localAddress, $listenHandler)

Like @see \io\vertx\jphp\core\net\NetServer::listen but providing a handler that will be notified when the server is listening, or fails.

param $port [integer] the port to listen on param $host [string] the host to listen on param $listenHandler [callable] handler that will be notified when listening or failed listen($port, $host, $listenHandler)

Arguments

$arg0

callable | integer | SocketAddress

$arg1

callable | string

$arg2

callable

Response

$this

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