An HTTP and WebSockets server.
You receive HTTP requests by providing a @see \io\vertx\jphp\core\http\HttpServer::requestHandler. As requests arrive on the server the handler will be called with the requests.
You receive WebSockets by providing a @see \io\vertx\jphp\core\http\HttpServer::websocketHandler. As WebSocket connections arrive on the server, the WebSocket is passed to the handler.
package |
Default |
---|
__construct()
actualPort() : integer
integer
the actual port the server is listening on.
close( $arg0 = null) : void
The close happens asynchronously and the server may not be closed until some time after the call has returned. close() Like @see \io\vertx\jphp\core\http\HttpServer::close but supplying a handler that will be called when the server is actually closed (or has failed). param $completionHandler [callable] the handler close($completionHandler)
callable
connectionHandler( $arg0) : $this
callable
$this
a reference to this, so the API can be used fluently
exceptionHandler( $arg0) : $this
callable
$this
a reference to this, so the API can be used fluently
isMetricsEnabled() : boolean
boolean
{@code true} if metrics are enabled
listen( $arg0 = null, $arg1 = null, $arg2 = null) : $this
see |
\io\vertx\jphp\core\http\HttpServerOptions
that was used when creating the server. The listen happens asynchronously and the server may not be listening until some time after the call has returned. listen() Like @see \io\vertx\jphp\core\http\HttpServer::listen but the server will listen on host "0.0.0.0" and port specified here ignoring any value in the @see \io\vertx\jphp\core\http\HttpServerOptions that was used when creating the server. param $port [integer] the port to listen on listen($port) Like @see \io\vertx\jphp\core\http\HttpServer::listen but supplying a handler that will be called when the server is actually listening (or has failed). param $listenHandler [callable] the listen handler listen($listenHandler) Tell the server to start listening. The server will listen on the port and host specified here, ignoring any value set in the @see \io\vertx\jphp\core\http\HttpServerOptions that was used when creating the server. The listen happens asynchronously and the server may not be listening until some time after the call has returned. param $port [integer] the port to listen on param $host [string] the host to listen on listen($port, $host) Tell the server to start listening on the given address supplying a handler that will be called when the server is actually listening (or has failed). param $address [SocketAddress] the address to listen on param $listenHandler [callable] the listen handler listen($address, $listenHandler) Like @see \io\vertx\jphp\core\http\HttpServer::listen but supplying a handler that will be called when the server is actually listening (or has failed). param $port [integer] the port to listen on param $listenHandler [callable] the listen handler listen($port, $listenHandler) Like @see \io\vertx\jphp\core\http\HttpServer::listen but supplying a handler that will be called when the server is actually listening (or has failed). param $port [integer] the port to listen on param $host [string] the host to listen on param $listenHandler [callable] the listen handler listen($port, $host, $listenHandler) |
---|
callable | integer | SocketAddress
callable | string
callable
$this
a reference to this, so the API can be used fluently
requestHandler( $arg0) : $this
callable
$this
a reference to this, so the API can be used fluently
requestStream() : \io\vertx\jphp\core\http\ReadStream<HttpServerRequest>
\io\vertx\jphp\core\http\ReadStream
the request stream
websocketHandler( $arg0) : $this
callable
$this
a reference to this, so the API can be used fluently
websocketStream() : \io\vertx\jphp\core\http\ReadStream<ServerWebSocket>
\io\vertx\jphp\core\http\ReadStream
the websocket stream