Create a new MqttWire instance for a client connection.
Lifecycle hooks (onSend and onConnect are required)
Configuration options
Get client ID (from CONNECT or assigned by server).
Get current connection state.
Check if connected.
Get client's maximum packet size (from CONNECT).
Get client's receive maximum (from CONNECT).
Get protocol version (negotiated from client CONNECT).
Disconnect the client.
Sends DISCONNECT packet (MQTT 5.0) and cleans up state.
Disconnect reason (default: 0x00 normal)
Optionalproperties: DisconnectPropertiesDISCONNECT properties
Publish a message to the client.
Topic name
Message payload
Publish options
Packet ID for QoS > 0, undefined for QoS 0
Process incoming data from transport.
Call this method with chunks of data received from the transport (TCP socket, WebSocket, etc.). Complete packets will be parsed and appropriate hooks called.
Incoming data chunk
Force cleanup of all state (for testing or full reset).
MQTT protocol connection state machine (server-side).
Handles incoming MQTT client connections, protocol parsing, encoding, QoS flows, keepalive, and connection lifecycle. Transport-agnostic: bytes in via
receive(), bytes out viaonSendhook.Example