TsgcWSPClient_MQTT › Events

TsgcWSPClient_MQTT Events

Events you can handle, grouped by purpose, followed by the full alphabetical list.

Lifecycle

NameDescription
OnMQTTBeforeConnectFires before the CONNECT packet is sent; lets the app override CleanSession and ClientIdentifier.
OnMQTTConnectFires after CONNACK is received; reports Session flag, ReasonCode and MQTT 5 ConnectProperties.
OnMQTTDisconnectFires when the broker sends a DISCONNECT or the session is closed; reports ReasonCode and MQTT 5 DisconnectProperties.
OnMQTTPingFires when the client receives a PINGRESP acknowledging a previously sent PINGREQ.
OnMQTTAuthFires during the MQTT 5 enhanced authentication exchange when the broker sends an AUTH packet.

Publish

NameDescription
OnMQTTPublishFires when the broker delivers an incoming PUBLISH message; exposes Topic, Text and MQTT 5 PublishProperties.
OnMQTTPublishExFires on incoming PUBLISH; delivers the payload as a TsgcWSMQTTPublishData (Value, Bytes, Stream) plus the raw TsgcWSMQTTMessage.
OnMQTTPubAckFires when a PUBACK is received for a QoS 1 publish (PUBLISH → PUBACK).
OnMQTTPubRecFires on the second leg of the QoS 2 handshake (PUBLISH → PUBREC → PUBREL → PUBCOMP).
OnMQTTPubRelFires on the third leg of the QoS 2 handshake when a PUBREL is received.
OnMQTTPubCompFires on the fourth and final leg of the QoS 2 handshake when a PUBCOMP is received.

Subscribe

NameDescription
OnMQTTSubscribeFires when a SUBACK is received in response to Subscribe; exposes per-topic reason codes and MQTT 5 SubscribeProperties.
OnMQTTUnSubscribeFires when an UNSUBACK is received in response to UnSubscribe; exposes per-topic reason codes and MQTT 5 UnsubscribeProperties.

All Events (alphabetical)

NameDescription
OnMQTTAuthFires during the MQTT 5 enhanced authentication exchange when the broker sends an AUTH packet.
OnMQTTBeforeConnectFires before the CONNECT packet is sent; lets the app override CleanSession and ClientIdentifier.
OnMQTTConnectFires after CONNACK is received; reports Session flag, ReasonCode and MQTT 5 ConnectProperties.
OnMQTTDisconnectFires when the broker sends a DISCONNECT or the session is closed; reports ReasonCode and MQTT 5 DisconnectProperties.
OnMQTTPingFires when the client receives a PINGRESP acknowledging a previously sent PINGREQ.
OnMQTTPubAckFires when a PUBACK is received for a QoS 1 publish (PUBLISH → PUBACK).
OnMQTTPubCompFires on the fourth and final leg of the QoS 2 handshake when a PUBCOMP is received.
OnMQTTPublishFires when the broker delivers an incoming PUBLISH message; exposes Topic, Text and MQTT 5 PublishProperties.
OnMQTTPublishExFires on incoming PUBLISH; delivers the payload as a TsgcWSMQTTPublishData (Value, Bytes, Stream) plus the raw TsgcWSMQTTMessage.
OnMQTTPubRecFires on the second leg of the QoS 2 handshake (PUBLISH → PUBREC → PUBREL → PUBCOMP).
OnMQTTPubRelFires on the third leg of the QoS 2 handshake when a PUBREL is received.
OnMQTTSubscribeFires when a SUBACK is received in response to Subscribe; exposes per-topic reason codes and MQTT 5 SubscribeProperties.
OnMQTTUnSubscribeFires when an UNSUBACK is received in response to UnSubscribe; exposes per-topic reason codes and MQTT 5 UnsubscribeProperties.