2.4.6.2. Messages from Client to Server¶
The client emits messages over two WebRTC data channels:
the reliable channel (id 100) for
Acknowledgement,OrthogonalAcknowledgement,ReceivedResources,ResourceLost,NodeStatus,DisplayInfoandHandshaketraffic that must not be lost;the unreliable channel (id 120) for per-frame messages:
ControllerPoses,InputStates,InputEvents,KeyframeRequestandPongForLatency.
Any reliable-channel message MAY instead be sent as a binary frame on the signaling WebSocket. The payload bytes are identical, and a client MUST use this fallback transport whenever the WebRTC reliable data channel is not yet open (notably for the initial Handshake). Servers MUST accept reliable messages on either transport for the lifetime of the session; see Reliable-channel transport fallback (binary WebSocket frames). The unreliable channel has no such fallback.
The Client sends all of its messages in its local units and AxesStandard. The Server is responsible for converting incoming data to its own internal representation, and for converting outgoing commands to the client’s units.
2.4.6.2.1. Common header¶
Every client-to-server message begins with the 9-byte ClientMessage header (reference: teleport::core::ClientMessage):
Bytes |
Type |
Description |
|---|---|---|
1 |
ClientMessagePayloadType |
The message type (see table below). |
8 |
int64 |
|
Id |
Name |
Reference struct |
|---|---|---|
0 |
|
(never sent) |
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
2.4.6.2.2. DisplayInfo (id = 8)¶
The byte layout (reference: teleport::core::DisplayInfoMessage):
Bytes |
Type |
Description |
|---|---|---|
9 |
ClientMessage |
Standard header ( |
4 |
uint32 |
|
4 |
uint32 |
|
4 |
float |
|
2.4.6.2.3. ControllerPoses (id = 4)¶
Sent on the unreliable channel (reference: teleport::core::NodePosesMessage).
Bytes |
Type |
Description |
|---|---|---|
9 |
ClientMessage |
Standard header ( |
28 |
Pose_packed |
|
2 |
uint16 |
|
N × 36 |
NodePose[] |
For each pose: 8-byte node uid, 28-byte |
2.4.6.2.4. ReceivedResources (id = 3)¶
Sent on the reliable channel (reference: teleport::core::ReceivedResourcesMessage).
Bytes |
Type |
Description |
|---|---|---|
9 |
ClientMessage |
Standard header ( |
8 |
size_t |
|
8 * N |
uid[] |
Resource uids that have been fully decoded and stored. |
2.4.6.2.5. NodeStatus (id = 2)¶
Sent on the reliable channel to tell the server which nodes the client is currently rendering, and which it has chosen to release (reference: teleport::core::NodeStatusMessage).
Bytes |
Type |
Description |
|---|---|---|
9 |
ClientMessage |
Standard header ( |
8 |
size_t |
|
8 |
size_t |
|
8 * N |
uid[] |
Drawn node uids. |
8 * M |
uid[] |
Node uids the client wants to release. |
2.4.6.2.6. ResourceLost (id = 5)¶
Sent on the reliable channel to tell the server that a previously-confirmed resource has been lost (e.g. due to a decoder error) and must be re-sent (reference: teleport::core::ResourceLostMessage).
Bytes |
Type |
Description |
|---|---|---|
9 |
ClientMessage |
Standard header ( |
2 |
uint16 |
|
8 * N |
uid[] |
Lost resource uids. |
2.4.6.2.7. InputStates (id = 6)¶
Sent on the unreliable channel each frame, after SetupInputs has been received. Carries the current value of every state-typed input declared by the server (reference: teleport::core::InputStatesMessage). See Input for the full input model.
Bytes |
Type |
Description |
|---|---|---|
9 |
ClientMessage |
Standard header ( |
2 |
uint16 |
|
2 |
uint16 |
|
B (bits, padded to bytes) |
bitfield |
One bit per declared binary-state input, in declaration order. |
4 * A |
float[] |
One float per declared analogue-state input, in declaration order. |
2.4.6.2.8. InputEvents (id = 7)¶
Sent on the unreliable channel when one or more event-typed inputs have fired since the last frame (reference: teleport::core::InputEventsMessage).
Bytes |
Type |
Description |
|---|---|---|
9 |
ClientMessage |
Standard header ( |
2 |
uint16 |
|
2 |
uint16 |
|
2 |
uint16 |
|
B × 7 |
InputEventBinary[] |
4-byte |
A × 10 |
InputEventAnalogue[] |
4-byte |
M × 14 |
InputEventMotion[] |
4-byte |
2.4.6.2.9. KeyframeRequest (id = 9)¶
Sent on the unreliable channel when the video decoder has lost sync; the server forces the encoder to emit the next frame as an IDR (reference: teleport::core::KeyframeRequestMessage).
Bytes |
Type |
Description |
|---|---|---|
9 |
ClientMessage |
Standard header ( |
2.4.6.2.10. PongForLatency (id = 10)¶
Sent on the unreliable channel in response to PingForLatency. The server uses the round-trip to estimate one-way latency (reference: teleport::core::PongForLatencyMessage).
Bytes |
Type |
Description |
|---|---|---|
9 |
ClientMessage |
Standard header ( |
8 |
int64 |
|
8 |
int64 |
|
2.4.6.2.11. Acknowledgement (id = 12)¶
Sent on the reliable channel in response to any AckedCommand (currently SetupLighting and SetOriginNode; reference: teleport::core::AcknowledgementMessage).
Bytes |
Type |
Description |
|---|---|---|
9 |
ClientMessage |
Standard header ( |
8 |
uint64 |
|
2.4.6.2.12. OrthogonalAcknowledgement (id = 11)¶
Sent on the reliable channel to confirm a single confirmationNumber carried by a NodeStateCommand (e.g. UpdateNodeStructure). Allows independent state updates to be confirmed without the monotonic ack_id ordering of AckedCommand (reference: teleport::core::OrthogonalAcknowledgementMessage).
Bytes |
Type |
Description |
|---|---|---|
9 |
ClientMessage |
Standard header ( |
8 |
uint64 |
|