MqttEndpoint

Represents an MQTT endpoint for point-to-point communication with the remote MQTT client

package

Default

Methods

__construct

__construct() 

Like @see \io\vertx\jphp\mqtt\MqttEndpoint::accept with no session is present.

accept( $arg0 = null) : $this

accept()

Sends the CONNACK message to the remote MQTT client with "connection accepted" return code. See @see \io\vertx\jphp\mqtt\MqttEndpoint::reject for refusing connection

param $sessionPresent [boolean] if a previous session is present accept($sessionPresent)

Arguments

$arg0

boolean

Response

$this

auth

auth() : \io\vertx\jphp\mqtt\MqttAuth

Response

\io\vertx\jphp\mqtt\MqttAuth

the Authentication information as provided by the remote MQTT client

Enable/disable auto keep alive (sending ping response)

autoKeepAlive( $arg0) : $this

Arguments

$arg0

boolean

Response

$this

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

clientIdentifier

clientIdentifier() : string

Response

string

the client identifier as provided by the remote MQTT client

Close the endpoint, so the connection with remote MQTT client

close() : void

Set a close handler. This will be called when the MQTT endpoint is closed

closeHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

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

Set a disconnect handler on the MQTT endpoint. This handler is called when a DISCONNECT message is received by the remote MQTT client

disconnectHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

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

Set an exception handler. This will be called when an error at protocol level happens

exceptionHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

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

isAutoKeepAlive

isAutoKeepAlive() : boolean

Response

boolean

the auto keep alive status (sending ping response)

isCleanSession

isCleanSession() : boolean

Response

boolean

true when clean session is requested by the remote MQTT client

isConnected

isConnected() : boolean

Response

boolean

if the connection between remote client and local endpoint is established/open

isPublishAutoAck

isPublishAutoAck() : boolean

Response

boolean

auto acknowledge status for publishing (in/out)

isSsl

isSsl() : boolean

Response

boolean

true if this {@link io.vertx.mqtt.MqttEndpoint} is encrypted via SSL/TLS.

isSubscriptionAutoAck

isSubscriptionAutoAck() : boolean

Response

boolean

true when auto acknowledge status for subscription/unsubscription requests

keepAliveTimeSeconds

keepAliveTimeSeconds() : integer

Response

integer

the keep alive timeout (in seconds) specified by the remote MQTT client

lastMessageId

lastMessageId() : integer

Response

integer

the message identifier used for last published message

localAddress

localAddress() : \io\vertx\jphp\core\net\SocketAddress

Response

\io\vertx\jphp\core\net\SocketAddress

the local address for this socket

Set the pingreq handler on the MQTT endpoint. This handler is called when a PINGREQ message is received by the remote MQTT client. In any case the endpoint sends the PINGRESP internally after executing this handler.

pingHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

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

Sends the PINGRESP message to the remote MQTT client

pong() : $this

Response

$this

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

protocolName

protocolName() : string

Response

string

the protocol name provided by the remote MQTT client

protocolVersion

protocolVersion() : integer

Response

integer

the protocol version required by the remote MQTT client

Sends the PUBLISH message to the remote MQTT client

publish( $arg0,  $arg1,  $arg2,  $arg3,  $arg4,  $arg5 = null) : $this

param $topic [string] topic on which the message is published param $payload [Buffer] message payload param $qosLevel [string] quality of service level param $isDup [boolean] if the message is a duplicate param $isRetain [boolean] if the message needs to be retained publish($topic, $payload, $qosLevel, $isDup, $isRetain)

Sends the PUBLISH message to the remote MQTT server

param $topic [string] topic on which the message is published param $payload [Buffer] message payload param $qosLevel [string] QoS level param $isDup [boolean] if the message is a duplicate param $isRetain [boolean] if the message needs to be retained param $publishSentHandler [callable] handler called after PUBLISH packet sent with a packetId publish($topic, $payload, $qosLevel, $isDup, $isRetain, $publishSentHandler)

Arguments

$arg0

string

$arg1

Buffer

$arg2

string

$arg3

boolean

$arg4

boolean

$arg5

callable

Response

$this

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

Sends the PUBACK message to the remote MQTT client

publishAcknowledge( $arg0) : $this

Arguments

$arg0

integer

Response

$this

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

Set the puback handler on the MQTT endpoint. This handler is called when a PUBACK message is received by the remote MQTT client

publishAcknowledgeHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

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

Enable/disable publishing (in/out) auto acknowledge

publishAutoAck( $arg0) : $this

Arguments

$arg0

boolean

Response

$this

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

Sends the PUBCOMP message to the remote MQTT client

publishComplete( $arg0) : $this

Arguments

$arg0

integer

Response

$this

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

Set the pubcomp handler on the MQTT endpoint. This handler is called when a PUBCOMP message is received by the remote MQTT client

publishCompletionHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

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

Set the publish handler on the MQTT endpoint. This handler is called when a PUBLISH message is received by the remote MQTT client

publishHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

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

Sends the PUBREC message to the remote MQTT client

publishReceived( $arg0) : $this

Arguments

$arg0

integer

Response

$this

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

Set the pubrec handler on the MQTT endpoint. This handler is called when a PUBREC message is received by the remote MQTT client

publishReceivedHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

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

Sends the PUBREL message to the remote MQTT client

publishRelease( $arg0) : $this

Arguments

$arg0

integer

Response

$this

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

Set the pubrel handler on the MQTT endpoint. This handler is called when a PUBREL message is received by the remote MQTT client

publishReleaseHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

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

Sends the CONNACK message to the remote MQTT client rejecting the connection request with specified return code. See @see \io\vertx\jphp\mqtt\MqttEndpoint::accept for accepting connection

reject( $arg0) : $this

Arguments

$arg0

string

Response

$this

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

remoteAddress

remoteAddress() : \io\vertx\jphp\core\net\SocketAddress

Response

\io\vertx\jphp\core\net\SocketAddress

the remote address for this socket

Set client identifier if not provided by the remote MQTT client (zero-bytes)

setClientIdentifier( $arg0) : $this

Arguments

$arg0

string

Response

$this

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

Sends the SUBACK message to the remote MQTT client

subscribeAcknowledge( $arg0,  $arg1) : $this

Arguments

$arg0

integer

$arg1

array

Response

$this

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

Set a subscribe handler on the MQTT endpoint. This handler is called when a SUBSCRIBE message is received by the remote MQTT client

subscribeHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

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

Enable/disable subscription/unsubscription requests auto acknowledge

subscriptionAutoAck( $arg0) : void

Arguments

$arg0

boolean

Sends the UNSUBACK message to the remote MQTT client

unsubscribeAcknowledge( $arg0) : $this

Arguments

$arg0

integer

Response

$this

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

Set a unsubscribe handler on the MQTT endpoint. This handler is called when a UNSUBSCRIBE message is received by the remote MQTT client

unsubscribeHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

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

will

will() : \io\vertx\jphp\mqtt\MqttWill

Response

\io\vertx\jphp\mqtt\MqttWill

the Will information as provided by the remote MQTT client