StompClient

Defines a STOMP client.

package

Default

Methods

__construct

__construct() 

Closes the client.

close() : void

Connects to the server using the host and port configured in the client's options.

connect( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null) : $this

param $resultHandler [callable] handler called with the connection result. A failure will be sent to the handler if a TCP level issue happen before the CONNECTED frame is received. Afterwards, the #exceptionHandler(Handler) is called. connect($resultHandler)

Connects to the server.

param $net [NetClient] the NET client to use param $resultHandler [callable] handler called with the connection result connect($net, $resultHandler)

Connects to the server.

param $port [integer] the server port param $host [string] the server host param $resultHandler [callable] handler called with the connection result connect($port, $host, $resultHandler)

Connects to the server.

param $port [integer] the server port param $host [string] the server host param $net [NetClient] the NET client to use param $resultHandler [callable] handler called with the connection result connect($port, $host, $net, $resultHandler)

Arguments

$arg0

callable | NetClient | integer

$arg1

callable | string

$arg2

callable | NetClient

$arg3

callable

Response

$this

the current {@link StompClient}

Creates a @see \io\vertx\jphp\ext\stomp\StompClient using the default implementation.

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

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

Creates a @see \io\vertx\jphp\ext\stomp\StompClient using the default implementation.

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

Arguments

$arg0

Vertx

$arg1

array | StompClientOptions

Response

\io\vertx\jphp\ext\stomp\StompClient

the created {@link StompClient}

A general error frame handler. It can be used to catch <code>ERROR</code> frame emitted during the connection process (wrong authentication). This error handler will be pass to all @see \io\vertx\jphp\ext\stomp\StompClientConnection created from this client. Obviously, the client can override it when the connection is established.

errorFrameHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current {@link StompClient}

Sets an exception handler notified for TCP-level errors.

exceptionHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current {@link StompClient}

isClosed

isClosed() : boolean

Response

boolean

whether or not the client is connected to the server.

options

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

Response

\io\vertx\jphp\ext\stomp\StompClientOptions

the client's options.

Configures a received handler that gets notified when a STOMP frame is received by the client.

receivedFrameHandler( $arg0) : $this

This handler can be used for logging, debugging or ad-hoc behavior. The frame can still be modified at the time.

When a connection is created, the handler is used as

see \io\vertx\jphp\ext\stomp\StompClientConnection::receivedFrameHandler.

Arguments

$arg0

callable

Response

$this

the current {@link StompClient}

vertx

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

Response

\io\vertx\jphp\core\Vertx

the vert.x instance used by the client.

Configures a writing handler that gets notified when a STOMP frame is written on the wire.

writingFrameHandler( $arg0) : $this

This handler can be used for logging, debugging or ad-hoc behavior. The frame can still be modified at the time.

When a connection is created, the handler is used as

see \io\vertx\jphp\ext\stomp\StompClientConnection::writingFrameHandler.

Arguments

$arg0

callable

Response

$this

the current {@link StompClient}