Xentara WebSocket API Specification v2.0.4
User Manual
|
OpCode | Name | Description |
---|---|---|
14 | client_hello | Convey client capabilities and facilitate session creation by exchanging parameters between the client and server. |
The parameter object outlined in request packet for this command includes:
ID | Name | Optional | Description |
---|---|---|---|
0 | minimum_protocol_version | no | An unsigned integer number indicating the minimum protocol version. It should be less than or equal to the maximum_protocol_version. |
1 | maximum_protocol_version | no | An unsigned integer number indicating the maximum protocol version. It should be greater than or equal to the minimum_protocol_version. |
The response item outlined in response packet for this command includes:
Name | Type | Description |
---|---|---|
Server Parameter | Object | An object containing the current server parameters (see below). |
The definition of server parameter object is mentioned below:
ID | Name | Description |
---|---|---|
0 | current_protocol_version | An unsigned integer specifying the current protocol version. |
If an error occurs, the response will include an error packet with detailed error information.
Below is the list of the potential errors that may be encountered with this command. Further details regarding errors in the Xentara WebSocket interface can be accessed here.
Sr. No. | Error Code | Error Description |
---|---|---|
1 | -32700 | Parse Error |
2 | -32603 | Internal Error |
3 | -32602 | Invalid Parameter |
4 | -32600 | Invalid Request |
5 | -32001 | Duplicate Client Hello Request |
Below is an example of a client hello request, specifying the minimum and maximum supported protocol versions by the client. The message id 65 is an arbitrary number assigned for this particular request.
[ 0, # Request Packet 65, # Message Id 14, # Client Hello OpCode { # Client Hello Object 0: 0, # Minimum Protocol Version 1: 1 # Maximum Protocol Version } ]
Below is an example of the successful response to the aforementioned request. It indicates a package type of 1, signifying a successful response. The provided Message ID is intended for matching with the corresponding request. The response consists of an object containing the current protocol version supported by the server.
[ 1, # Packet Type - Success Response 65, # Message Id { 0: 1 # Current Protocol Version of the Server } ]