...
payloadType
There are currently five four payload types defined and three reserved:. The rest are reserved.
PT_DATA = 0
A regular data fragment. The payload is a binary blob.
...
A request to the server to open a new session or a response from the server for
such a request. The payload must be empty for a session open request (for now)
and is defined below for a session open response.
PT_RESERVED_1 = 3
Reserved for future use.
PT_BAD_SESSION = 4
A response from the server that the session specified is not valid. The payload
must be empty.
PT_RETRY_WITH_NEW_RPCID = 5
A response from the server that it has discarded its state for the rpcId
specified (but the session is still valid). The payload must be empty.
PT_RESERVED_2 = 6
Reserved for future use.
PT_RESERVED_3 = 7
Reserved for future use.
sessionToken
The session token serves to identify the session. It is large enough that it
can be generated randomly with a very low probability of collisions.
...
The RPC ID serves to ensure that old packets on a channel that is still valid
are ignored. The client may must start the RPC ID with any value 0 on a new channel (0
is a reasonable choice), and must
increment it on every new RPC that it sends
over the channel.
fragNumber
...