Socket.IO Packet
Packets are encoded in the Socket.IO protocol. Read a breakdown of the sample session or read more about the session lifecycle.
Packet Contents
Description | Data type | Optional |
---|---|---|
A packet type | integer | |
A namespace | string | |
A payload | Object or Array | x |
An acknowledgement ID | integer | x |
Packet Types
Type | ID | Usage |
---|---|---|
CONNECT | 0 | Used during the connection to a namespace. |
DISCONNECT | 1 | Used when disconnecting from a namespace. |
EVENT | 2 | Used to send data to the other side. |
ACK | 3 | Used to acknowledge an event. |
CONNECT_ERROR | 4 | Used during the connection to a namespace. |
BINARY_EVENT | 5 | Used to send binary data to the other side. |
BINARY_ACK | 6 | Used to acknowledge an event (the response includes binary data). |