-
Notifications
You must be signed in to change notification settings - Fork 2
Version4
String (text) values are encoded using UTF-8, prefixed with an integer length. Lengths greater than 0x7fffffff
are disallowed.
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
- 34 - Channel Data Ack
- 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
| lsb | - 8 bytes
| msb | - 8 bytes
| hint len | - 4 bytes
| hint string | - <hint len> bytes
|---------------|
| 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 (encoded UUID plus possible "hint" text)
- Connection Args - arguments associated with the connection (often user credentials, but can be anything needed by the application (encoded 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 (encoded 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
| lsb | - 8 bytes
| hsb | - 8 bytes
| hint len | - 4 bytes
| hint string | - <hint len> bytes
|---------------|
|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 server VM (encoded UUID plus possible "hint" text)
- 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 (encoded 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.
---------------
|Has Recon Token| - 1 byte
|---------------|
~~~ ~~~
| (Optional) |
|Reconnect Token| - Varies
~~~ ~~~
---------------
- 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 (encoded object).
Indicates that the session is being closed for some (possibly noted) reason.
---------------
| Reason Length | - 4 bytes
|---------------|
~~~ ~~~
| (Optional) |
| Reason | - Varies
| String |
~~~ ~~~
|---------------|
|Is Auth Failure| - 1 byte
---------------
- Reason - A human-friendly message indicating the reason for the close (UTF-8 string). This will be omitted if "reason length" was 0.
- 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.
---------------
| |
| Call | - 4 bytes
| ID |
| |
|---------------|
| |
| Object | - 4 bytes
| ID |
| |
|---------------|
| |
| Method | - 4 bytes
| ID |
| |
|---------------|
| Flags | - 1 byte
|---------------|
|(Opt) Num Args | - 1 byte
|---------------|
~~~ ~~~
| (Optional) |
| Args | - Varies
~~~ ~~~
|---------------|
|Persistent Name|
| Length | - 4 bytes
|---------------|
~~~ ~~~
| (Optional) |
|Persistent Name| - Varies (UTF-8)
~~~ ~~~
|---------------|
~~~ ~~~
| (Optional) |
| User Context | - Varies
~~~ ~~~
---------------
- 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 - unused
- 0x04 - whether or not a user context is provided
- 0x08 - whether or not server-side performance statistics are requested
- Args - arguments to the invocation (encoded objects)
- Persistent Name - if length was non-zero, this name can be used to find the requested object for the case where the object ID is unknown to the server (UTF-8)
- User Context - application-specific context for the user making the call (encoded object)
---------------
| |
| Call | - 4 bytes
| ID |
| |
|---------------|
| Flags | - 1 byte
|---------------|
~~~ ~~~
| (Optional) |
| Value | - Varies
~~~ ~~~
|---------------|
| |
| (Optional) |
| New Object ID | - 4 bytes
| |
|---------------|
| |
| (Optional) |
| Server Time | - 4 bytes
| |
---------------
- 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 (encoded 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.
---------------
| |
| Call | - 4 bytes
| ID |
| |
---------------
- Call ID - identifier for the call, from Invoke message
Sent by the server to indicate that it is processing a method invocation.
---------------
| |
| Call | - 4 bytes
| ID |
| |
---------------
- 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.
---------------
| OID Count | - 1 byte
|---------------|
~~~ ~~~
| OIDs | - "OID Count" * 4 bytes
~~~ ~~~
---------------
- 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.
---------------
| OID Count | - 1 byte
|---------------|
~~~ ~~~
| OIDs | - "OID Count" * 4 bytes
~~~ ~~~
---------------
- 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".
---------------
| |
| Request | - 4 bytes
| ID |
| |
|---------------|
|Has Attachment | - 1 byte
|---------------|
~~~ ~~~
| Attachment | - Varies
~~~ ~~~
|---------------|
| Channel | - 2 bytes
| ID |
|---------------|
| |
| Rx Window | - 4 bytes
| Size |
| |
---------------
- 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, encoded object)
- Channel ID - Identifier to be used for the channel
- Rx Window Size - Initial size of the receive window for the initiating peer. Four signed bytes where the high bit may not be set.
Sent in response to a Channel Init message.
---------------
| |
| Request | - 4 bytes
| ID |
| |
|---------------|
| Was Rejected | - 1 byte
|---------------|
| Reject Reason |
| Length | - 4 bytes
|---------------|
~~~ ~~~
| (Optional) |
| Reject Reason | - Varies
~~~ ~~~
|---------------|
| |
| Rx Window | - 4 bytes
| Size |
| |
---------------
- 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 (UTF-8)
- Rx Window Size - Initial size of the receive window for the responding peer. This
section is only included if the channel is not rejected (
0in the "Was Rejected" slot). Four signed bytes where the high bit may not be set.
Sends a chunk of channel data.
---------------
| Channel ID | - 2 bytes
| |
|---------------|
| |
| Data Length | - 4 bytes
| |
| |
|---------------|
~~~ ~~~
| Data | - Varies
~~~ ~~~
---------------
- Channel ID - identifier for the channel
- Data - application-specific binary data
Acknowledges processing of a set of ChannelData messages. This is used for channel flow control.
---------------
| Channel ID | - 2 bytes
| |
|---------------|
| Message ID | - 2 bytes
| |
|---------------| or |---------------|
| | | 0x8000 | - 1 byte
| New Receive | - 4 bytes ---------------
| Window Size |
| |
---------------
- Channel ID - identifier for the channel
- Message ID - ID of the latest message to be processing. This and all preceding messages are acknowledged by the message.
- New Receive Window Size - New size of the receive window for the channel. If the window size is unchanged from the previous ack, one byte with the high bit set can be sent (0x8000, typical). Otherwise the value is four signed bytes where the high bit may not be set.
Sent to indicate a channel is or should be closed. This may be sent by either the client or server.
---------------
| 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.
---------------
| 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.
---------------
| 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