Packet Types
Reference WKProto FrameType values, directions, core fields, and current publication scope.
FrameType occupies the high four bits of the fixed header. UNKNOWN=0 is reserved and must not be sent. Enum presence does not mean the product Gateway supports that packet.
| Value / name | Direction | Scope | Meaning |
|---|---|---|---|
0 · UNKNOWN | — | Reserved | Wire-reserved; do not send; it never reaches product handling. |
1 · CONNECT | Client → Server | Public core | Must be the sole first packet on a connection. |
2 · CONNACK | Server → Client | Public core | Returns connection result and session material; v4+ requests also receive the negotiated version. |
3 · SEND | Client → Server | Public core | Submits one Channel message. |
4 · SENDACK | Server → Client | Public core | Correlates a SEND with its protocol result. |
5 · RECV | Server → Client | Public core | Delivers one message to the current Session. |
6 · RECVACK | Client → Server | Public core | Acknowledges client handling of a specific RECV. |
7 · PING | Client → Server | Public core | Refreshes inbound activity and requests PONG. |
8 · PONG | Server → Client | Public core | Bodyless response to PING. |
9 · DISCONNECT | Client ↔ Server | Codec only | Bidirectional codec contract; the current product Gateway publishes neither client ingress nor server emission. |
10 · SUB | Client → Server | Codec only | Codec exists; current product Gateway ingress does not support it. |
11 · SUBACK | Server → Client | Codec only | Codec response for SUB; current product entry is unpublished. |
12 · EVENT | Client ↔ Server | Reserved | The current product Gateway uses it only for benchmark terminal-fence request and acknowledgement; it is not an application event API. |
Core fields
| Packet | Body fields |
|---|---|
CONNECT | version, client_key, device_id, device_flag, millisecond timestamp, uid, token |
CONNACK | negotiated version for v4+ requests, server_key, salt, time difference, Reason Code, v4+ node_id |
SEND | Setting, 32-bit wire client_seq, client_msg_no, Channel, v3+ expire, msg_key, optional Topic, Payload |
SENDACK | message_id, client_seq, message_seq, Reason Code, optional client_msg_no |
RECV | Setting, msg_key, sender, Channel, v3+ expire, client_msg_no, message_id, message_seq, second timestamp, optional Topic, Payload |
RECVACK | message_id, message_seq |
PING / PONG | No body; the complete packet is one fixed-header byte |
Protocol v5 and earlier use a 32-bit message_seq; v6 uses 64 bits. The wire width of client_seq is always 32 bits. The current encoder limits SEND Payload to 32,767 bytes; the decoder rejects frames whose remaining length exceeds 1 MiB.
See Message Flags for fixed-header and Setting bits, Device Flags for device values, Channel Types for Channel values, and Reason Codes for outcomes.
Do not use unpublished packets
The current product Gateway accepts no ordinary inbound DISCONNECT, SUB, or arbitrary EVENT; EVENT is only for benchmark terminal-fence. UNKNOWN=0 never reaches product handling. Unknown numeric types, malformed frames, and decoded-but-unpublished packets fail closed through protocol-error, handler-error, or bounded-timeout paths.