StompServer

Defines a STOMP server. STOMP servers delegates to a @see \io\vertx\jphp\ext\stomp\StompServerHandler that let customize the behavior of the server. By default, it uses a handler compliant with the STOMP specification, but let you change anything.

package

Default

Methods

__construct

__construct() 

Gets the port on which the server is listening.

actualPort() : integer

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

Response

integer

the port

Closes the server.

close( $arg0 = null) : void

close()

Closes the server.

param $completionHandler [callable] handler called once the server has been stopped close($completionHandler)

Arguments

$arg0

callable

Creates a @see \io\vertx\jphp\ext\stomp\StompServer based on the default Stomp Server implementation, and use the default options.

create( $arg0,  $arg1 = null,  $arg2 = null) : \io\vertx\jphp\ext\stomp\StompServer
static

param $vertx [Vertx] the vert.x instance to use create($vertx)

Creates a @see \io\vertx\jphp\ext\stomp\StompServer based on the default Stomp Server implementation.

param $vertx [Vertx] the vert.x instance to use param $options [StompServerOptions | array] the server options create($vertx, $options)

Creates a @see \io\vertx\jphp\ext\stomp\StompServer based on the default Stomp Server implementation.

param $vertx [Vertx] the vert.x instance to use param $netServer [NetServer] the Net server used by the STOMP server create($vertx, $netServer)

Creates a @see \io\vertx\jphp\ext\stomp\StompServer based on the default Stomp Server implementation.

param $vertx [Vertx] the vert.x instance to use param $net [NetServer] the Net server used by the STOMP server param $options [StompServerOptions | array] the server options create($vertx, $net, $options)

Arguments

$arg0

Vertx

$arg1

array | StompServerOptions | NetServer

$arg2

array | StompServerOptions

Response

\io\vertx\jphp\ext\stomp\StompServer

the created {@link StompServer}

Configures the @see \io\vertx\jphp\ext\stomp\StompServerHandler. You must calls this method before calling the @see \io\vertx\jphp\ext\stomp\StompServer::listen method.

handler( $arg0) : $this

Arguments

$arg0

StompServerHandler

Response

$this

the current {@link StompServer}

Checks whether or not the server is listening.

isListening() : boolean

Response

boolean

{@code true} if the server is listening, {@code false} otherwise

Connects the STOMP server to the port / host configured in the server options.

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

listen()

Connects the STOMP server to the given port.

param $port [integer] the port listen($port)

Connects the STOMP server default port (61613) and network interface (0.0.0.0). Once the socket it bounds calls the given handler with the result. The result may be a failure if the socket is already used.

param $handler [callable] the handler to call with the result listen($handler)

Connects the STOMP server to the given port / interface.

param $port [integer] the port param $host [string] the interface listen($port, $host)

Connects the STOMP server to the given port. This method use the default host (0.0.0.0). Once the socket it bounds calls the given handler with the result. The result may be a failure if the socket is already used.

param $port [integer] the port param $handler [callable] the handler to call with the result listen($port, $handler)

Connects the STOMP server to the given port / interface. Once the socket it bounds calls the given handler with the result. The result may be a failure if the socket is already used.

param $port [integer] the port param $host [string] the host / interface param $handler [callable] the handler to call with the result listen($port, $host, $handler)

Arguments

$arg0

callable | integer

$arg1

callable | string

$arg2

callable

Response

$this

the current {@link StompServer}

options

options() : \io\vertx\jphp\ext\stomp\StompServerOptions

Response

\io\vertx\jphp\ext\stomp\StompServerOptions

the server options

stompHandler

stompHandler() : \io\vertx\jphp\ext\stomp\StompServerHandler

Response

\io\vertx\jphp\ext\stomp\StompServerHandler

the {@link StompServerHandler} used by this server.

vertx

vertx() : \io\vertx\jphp\core\Vertx

Response

\io\vertx\jphp\core\Vertx

the instance of vert.x used by the server.

Gets the able to manage web socket connections. If the web socket bridge is disabled, it returns <code>null</code>.

webSocketHandler() : callable

Response

callable

the handler that can be passed to {@link io.vertx.core.http.HttpServer#websocketHandler(Handler)}.

Configures the handler that is invoked every time a frame is going to be written to the "wire". It lets you log the frames, but also adapt the frame if needed.

writingFrameHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current {@link StompServer}