SimQ uses a self-written binary protocol.

The response format is identical to the request format: the first 8 bytes contain information about the response/request code and message length. The message length itself is formed from the transmitted information and its length. For example, you need to send a request with the code 1 and the string hello. The request will look like this: {1}4 {10}4 {6}4 {hello}6.

Or, you need to send a request with the code 1 and the lines hello, world. The request will look like this: {1}4 {20}4 {6}4 {hello}6 {6}4 {world}6.

The numbers are transmitted converted to the network byte order.
Strings are passed with a closing null byte.

At the very beginning of the connection, a request is created for an unsafe connection (code 102, expected response code 10, body 0) and getting the API version of the server (code 201, expected response code 10, the response body contains the API version number).

Ok code − 10
Error code − 20

Any API method can return an error.
Example of error format: {20}4 {25}4 {21}4 {Description of error}21
Example of ok format: {10}4 {0}4

2023 © i@trusow.ru