Xentara WebSocket API Specification v2.0.3
User Manual
Client Hello Command

Command

OpCodeNameDescription
14client_helloConvey client capabilities and facilitate session creation by exchanging parameters between the client and server.

Parameters

The parameter object outlined in request packet for this command includes:

IDNameOptionalDescription
0minimum_protocol_versionnoAn unsigned integer number indicating the minimum protocol version. It should be less than or equal to the maximum_protocol_version.
1maximum_protocol_versionnoAn unsigned integer number indicating the maximum protocol version. It should be greater than or equal to the minimum_protocol_version.

Response

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:

IDNameDescription
0current_protocol_versionAn unsigned integer specifying the current protocol version.

If an error occurs, the response will include an error packet with detailed error information.

Errors

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

Examples

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
  }
]

Response

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
  }
]