-
Notifications
You must be signed in to change notification settings - Fork 2
Version2
In protocol version 2, string (text) values are encoded using UTF-16, 0x00 terminated
or serialized ResourceKey Java objects (from the StarLight Common library, intended for
localization).
The following lists message types:
- 1 - Session Init
- 2 - Session Init Response
- 5 - Session Token Change
- 9 - Session Close
- 10 - Invoke
- 11 - Invoke Return
- 12 - Invoke Interrupt
- 13 - Invoke Ack
- 20 - Lease
- 21 - Lease Release
- 30 - Channel Init
- 31 - Channel Init Response
- 32 - Channel Data
- 33 - Channel Close
- 40 - Ping
- 41 - Ping Response
This must always be the first message sent by a client to initiate the session.
---------------
| Version | - 1 byte
|---------------|
| Min Proto Ver | - 1 byte
|---------------|
| Pref Proto Ver| - 1 byte
|---------------|
~~~ ~~~
| VMID | - Varies
~~~ ~~~
|---------------|
| Has Conn Args | - 1 byte
|---------------|
~~~ ~~~
| (Optional) |
|Connection Args| - Varies
~~~ ~~~
|---------------|
|Has Server Port| - 1 byte
|---------------|
| |
| (Optional) | - 4 bytes
| Server Port |
| |
|---------------|
|Has Recon Token| - 1 byte
|---------------|
~~~ ~~~
| (Optional) |
|Reconnect Token| - Varies
~~~ ~~~
|---------------|
| Req Ack Rate | - 1 byte
---------------
- Version - indicates the message version
- 0 - initial version
- 1 - Added Server Port
- 2 - Added Reconnection Tokens
- 3 - Request Ack Rate
- Min Protocol Version - lowest protocol version supported by the client
- See "Preferred Protocol Version" for possible values
- Preferred Protocol Version - highest protocol version supported by the client
- 0 - initial release
- 1 - reconnect token handling, introduction of SessionTokenChangeIMessage
- 2 - method invocation acknowledgement, introduction of InvokeAckIMessage
- 3 - (see #16) channel data flow control
- VMID - Identifier for the client VM (serialized object)
- Connection Args - arguments associated with the connection (often user credentials, but can be anything needed by the application (serialized object)
- Caller Server Port - the port on which the client is listening for connections (allows the server to connect back if necessary)
- Reconnect Token - optional, application-specific data for reconnections which can be used as an alternate means of authentication or some other context (serialized object)
- Ack Rate - Rate (in seconds) at which the client requests Invoke Ack messages be sent while invocations are processing. This value may or may not be honored by the server.
In response to a Session Init message sent by a client, the server will send either this message to indicate success to Session Close to indicate failure.
---------------
| Version | - 1 byte
|---------------|
| Proto Version | - 1 byte
|---------------|
~~~ ~~~
| VMID | - Varies
~~~ ~~~
|---------------|
|Has Server Port| - 1 byte
|---------------|
| |
| (Optional) | - 4 bytes
| Server Port |
| |
|---------------|
|Has Recon Token| - 1 byte
|---------------|
~~~ ~~~
| (Optional) |
|Reconnect Token| - Varies
~~~ ~~~
|---------------|
| Ack Rate | - 1 byte
---------------
- Version - indicates the message version
- 0 - initial version
- 1 - Added Server Port
- 2 - Added Reconnection Tokens
- 3 - Request Ack Rate
- Proto Version - protocol version that will be used for session
- VMID - Identifier for the client VM (serialized object)
- Server Port - Main port on which the server is listening for connections
- Reconnect Token - If provided, the caller should use this token when reconnecting in place of other credentials (serialized object, see Session Token Change message)
- Ack Rate - Rate (in seconds) at which the caller can expect Invoke Ack messages while invocations are processing. If not provided, acknowledgements are not supported.
---------------
| Version | - 1 byte
|---------------|
|Has Recon Token| - 1 byte
|---------------|
~~~ ~~~
| (Optional) |
|Reconnect Token| - Varies
~~~ ~~~
---------------
- Version - indicates the message version
- 0 - initial version
- Reconnect Token - The new reconnection token which should be used for authentication if the client needs to reconnect. A token may not be provided where it was previously, which means that the client should fall back to normal authentication for reconnection. (serialized object)
Indicates that the session is being closed for some (possibly noted) reason.
---------------
| Version | - 1 byte
|---------------|
| Has Reason | - 1 byte
|---------------|
~~~ ~~~
| (Optional) |
| Reason | - Varies
~~~ ~~~
|---------------|
|Is Auth Failure| - 1 byte
---------------
- Version - indicates the message version
- 0 - initial version
- Reason - A human-friendly message indicating the reason for the close (serialized object)
- Is Auth Failure - Indicates whether or not the close was caused by some type of authentication failure. This is provided so that clients will not keep retrying and possibly lock out a user's account.
Initiates a remote call on an object located on the server.
---------------
| Version | - 1 byte
|---------------|
| |
| Call | - 4 bytes
| ID |
| |
|---------------|
| |
| Object | - 4 bytes
| ID |
| |
|---------------|
| |
| Method | - 4 bytes
| ID |
| |
|---------------|
| Flags | - 1 byte
|---------------|
|(Opt) Num Args | - 1 byte
|---------------|
~~~ ~~~
| (Optional) |
| Args | - Varies
~~~ ~~~
|---------------|
~~~ ~~~
| (Optional) |
|Persistent Name| - Name length * 2 bytes
~~~ ~~~
|---------------|
| (If has name) | - 2 bytes
| 0x00 |
|---------------|
~~~ ~~~
| (Optional) |
| User Context | - Varies
~~~ ~~~
---------------
- Version - indicates the message version
- 0 - initial version
- Call ID - identifier for the call, unique to the client.
- Object ID - identifier for the object on which the call is being made. Note the "0" is reserved for the Registry.
- Method ID - identifier for the method being invoked (unique to the object)
- Flags - indicates data to follow and other settings relative to the invocation
- 0x01 - whether or not the invocation has arguments
- 0x02 - whether or not a persistent name is included for the object (see below)
- 0x04 - whether or not a user context is provided
- 0x08 - whether or not server-side performance statistics are requested
- Args - arguments to the invocation (serialized objects)
- Persistent Name - if provided, this name can be used to find the requested object for the case where the object ID is unknown to the server (UTF-16 encoded string)
- User Context - application-specific context for the user making the call (serialized object)
---------------
| Version | - 1 byte
|---------------|
| |
| Call | - 4 bytes
| ID |
| |
|---------------|
| Flags | - 1 byte
|---------------|
~~~ ~~~
| (Optional) |
| Value | - Varies
~~~ ~~~
|---------------|
| |
| (Optional) |
| New Object ID | - 4 bytes
| |
|---------------|
| |
| (Optional) |
| Server Time | - 4 bytes
| |
---------------
- Version - indicates the message version
- 0 - initial version
- Call ID - identifier for the call, from Invoke message
- Flags - indicates data to follow and other settings relative to the invocation result
- 0x01 - has "normal" value (1 & 2 cannot both be set)
- 0x02 - has "thrown" value (1 & 2 cannot both be set)
- 0x04 - indicates that the invoked object has a new identifier
- 0x08 - whether or not server performance statistics are included
- Value - the result or thrown value (serialized object)
- New Object ID - the new identifier for the invoked object
- Server Time - the time (in nanoseconds) spent by the server processing the invocation
Sent by the client to attempt to interrupt a method invocation.
---------------
| Version | - 1 byte
|---------------|
| |
| Call | - 4 bytes
| ID |
| |
---------------
- Version - indicates the message version
- 0 - initial version
- Call ID - identifier for the call, from Invoke message
Sent by the server to indicate that it is processing a method invocation.
---------------
| Version | - 1 byte
|---------------|
| |
| Call | - 4 bytes
| ID |
| |
---------------
- Version - indicates the message version
- 0 - initial version
- Call ID - identifier for the call, from Invoke message
Sent by the client to indicate that it is holding references to one or more objects. This is used by distributed garbage collection to prevent the server from freeing objects in use by clients.
---------------
| Version | - 1 byte
|---------------|
| OID Count | - 1 byte
|---------------|
~~~ ~~~
| OIDs | - "OID Count" * 4 bytes
~~~ ~~~
---------------
- Version - indicates the message version
- 0 - initial version
- OIDs - Identifiers for the objects for which the client is renewing its lease
Sent by the client to indicate that it is no longer using one or more objects. This is not strictly required (it could simply stop sending Lease messages), but is a nice thing to do because it allows the server to free resources sooner.
---------------
| Version | - 1 byte
|---------------|
| OID Count | - 1 byte
|---------------|
~~~ ~~~
| OIDs | - "OID Count" * 4 bytes
~~~ ~~~
---------------
- Version - indicates the message version
- 0 - initial version
- OIDs - Identifiers for the objects for which the client is renewing its lease
Sent to indicate that the caller would like to open a "virtual byte channel".
---------------
| Version | - 1 byte
|---------------|
| |
| Request | - 4 bytes
| ID |
| |
|---------------|
|Has Attachment | - 1 byte
|---------------|
~~~ ~~~
| Attachment | - Varies
~~~ ~~~
|---------------|
| Channel | - 2 bytes
| ID |
---------------
- Version - indicates the message version
- 0 - initial version
- Request ID - Identifier used by the caller to associate the request and response
- Attachment - An optional, application-specific object used for routing the channel on the server (think: port, serialized object)
- Channel ID - Identifier to be used for the channel
Sent in response to a Channel Init message.
---------------
| Version | - 1 byte
|---------------|
| |
| Request | - 4 bytes
| ID |
| |
|---------------|
| Was Rejected | - 1 byte
|---------------|
|(Opt)Has Reason| - 1 byte
|---------------|
~~~ ~~~
| (Optional) |
| Reject | - Varies
| Reason |
---------------
- Version - indicates the message version
- 0 - initial version
- Request ID - Identifier for the request provided in the Channel Init message
- Was Rejected - Indicates whether the request was approved or rejected
- Reason - An optional, human-friendly reason why the channel was rejected (serialized object)
Sends a chunk of channel data.
---------------
| Version | - 1 byte
|---------------|
| Channel ID | - 2 bytes
| |
|---------------|
| |
| Data Length | - 4 bytes
| |
| |
|---------------|
~~~ ~~~
| Data | - Varies
~~~ ~~~
---------------
- Version - indicates the message version
- 0 - initial version
- Channel ID - identifier for the channel
- Data - application-specific binary data
Sent to indicate a channel is or should be closed. This may be sent by either the client or server.
---------------
| Version | - 1 byte
|---------------|
| Channel ID | - 2 bytes
| |
---------------
- Version - indicates the message version
- 0 - initial version
- Channel ID - Identifier for the channel
Sent for test purposes. Will be followed by a Ping Response.
---------------
| Version | - 1 byte
|---------------|
| Sequence | - 2 bytes
| Number |
---------------
- Version - indicates the message version
- 0 - initial version
- Sequence Number - a number meaningful to the caller which will allow associating the request and response
Sent in response to a Ping message.
---------------
| Version | - 1 byte
|---------------|
| Sequence | - 2 bytes
| Number |
---------------
- Version - indicates the message version
- 0 - initial version
- Sequence Number - a number meaningful to the caller which will allow associating the request and response