Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
developers:websocket [2025/03/14 17:50] – chad | developers:websocket [2025/03/14 19:15] (current) – [Message Structure Overview] chad | ||
---|---|---|---|
Line 4: | Line 4: | ||
==== WebSockets ==== | ==== WebSockets ==== | ||
- | WebSockets establish a persistent, full-duplex connection between the client and server, allowing for continuous message exchange | + | WebSockets establish a persistent, full-duplex connection between the client and server, allowing for continuous |
**Key Advantages: | **Key Advantages: | ||
Line 25: | Line 25: | ||
==== Message Structure Overview ==== | ==== Message Structure Overview ==== | ||
- | All messages are wrapped within a top-level client or server message envelope. This structure ensures extensibility and consistency across different message types. | ||
- | **Example | + | All messages sent to the server must be wrapped in a **ClientMessage** envelope, and all messages received from the server will be contained within a **ServerMessage** envelope. This ensures a consistent structure and simplifies message parsing. |
- | ``` | + | |
+ | === Client Message Structure === | ||
+ | |||
+ | A **ClientMessage** is the top-level wrapper for all messages sent to the server. It contains fields for various message types, such as authentication requests, order submissions, | ||
+ | |||
+ | Example **ClientMessage**: | ||
+ | |||
+ | < | ||
message ClientMessage { | message ClientMessage { | ||
oneof payload { | oneof payload { | ||
- | | + | |
- | | + | |
+ | OrderRequest order_request = 3; | ||
+ | // ... other client messages | ||
} | } | ||
} | } | ||
+ | </ | ||
+ | === Server Message Structure === | ||
+ | |||
+ | A **ServerMessage** is the top-level wrapper for all responses and updates from the server. It encapsulates messages related to market data, account updates, and execution reports. | ||
+ | |||
+ | Example **ServerMessage**: | ||
+ | |||
+ | < | ||
message ServerMessage { | message ServerMessage { | ||
oneof payload { | oneof payload { | ||
- | | + | |
- | | + | |
+ | OrderUpdate order_update = 3; | ||
+ | // ... other server messages | ||
} | } | ||
} | } | ||
- | ``` | + | </ |
+ | |||
+ | |||
+ | === Message Tools === | ||
+ | |||
+ | The [[https:// | ||
+ | |||
+ | < | ||
+ | Reach out to support if you would like a API tool's for a language we have not covered yet. | ||
+ | </ | ||
+ | |||
+ | ^ **Platform** ^ **Client Message Helper** ^ | ||
+ | | **.Net** | [[https:// | ||
+ | |||
- | This design enables efficient message parsing while maintaining flexibility. | ||
- | ==== Next Steps ==== | ||
- | Continue to the **[Connecting and Authenticating](developers: | ||