com.sun.sgs.protocol.simple
Interface SimpleSgsProtocol


public interface SimpleSgsProtocol

SGS Protocol constants.

A protocol message is constructed as follows:

A ByteArray is encoded as follows:

Note: Messages may need to include explicit array length fields if they include more than one ByteArray.

A String is encoded as follows:


Field Summary
static byte CHANNEL_JOIN
          Channel join.
static byte CHANNEL_LEAVE
          Channel leave.
static byte CHANNEL_MESSAGE
          Channel message.
static byte LOGIN_FAILURE
          Login failure.
static byte LOGIN_REDIRECT
          Login redirect.
static byte LOGIN_REQUEST
          Login request from a client to a server.
static byte LOGIN_SUCCESS
          Login success.
static byte LOGOUT_REQUEST
          Logout request from a client to a server.
static byte LOGOUT_SUCCESS
          Logout success.
static int MAX_MESSAGE_LENGTH
          The maximum length of a protocol message: 65535 bytes.
static int MAX_PAYLOAD_LENGTH
          The maximum payload length: 65532 bytes.
static byte RECONNECT_FAILURE
          Reconnect failure.
static byte RECONNECT_REQUEST
          Reconnection request.
static byte RECONNECT_SUCCESS
          Reconnect success.
static byte SESSION_MESSAGE
          Session message.
static byte VERSION
          The version number, currently 0x04.
 

Field Detail

MAX_MESSAGE_LENGTH

static final int MAX_MESSAGE_LENGTH
The maximum length of a protocol message: 65535 bytes.

See Also:
Constant Field Values

MAX_PAYLOAD_LENGTH

static final int MAX_PAYLOAD_LENGTH
The maximum payload length: 65532 bytes.

See Also:
Constant Field Values

VERSION

static final byte VERSION
The version number, currently 0x04.

See Also:
Constant Field Values

LOGIN_REQUEST

static final byte LOGIN_REQUEST
Login request from a client to a server.
Opcode: 0x10
Payload:

See Also:
Constant Field Values

LOGIN_SUCCESS

static final byte LOGIN_SUCCESS
Login success. Server response to a client's LOGIN_REQUEST.
Opcode: 0x11
Payload:

See Also:
Constant Field Values

LOGIN_FAILURE

static final byte LOGIN_FAILURE
Login failure. Server response to a client's LOGIN_REQUEST.
Opcode: 0x12
Payload:

See Also:
Constant Field Values

LOGIN_REDIRECT

static final byte LOGIN_REDIRECT
Login redirect. Server response to a client's LOGIN_REQUEST.
Opcode: 0x13
Payload:

See Also:
Constant Field Values

RECONNECT_REQUEST

static final byte RECONNECT_REQUEST
Reconnection request. Client requesting reconnect to a server.
Opcode: 0x20
Payload:

See Also:
Constant Field Values

RECONNECT_SUCCESS

static final byte RECONNECT_SUCCESS
Reconnect success. Server response to a client's RECONNECT_REQUEST.
Opcode: 0x21
Payload:

See Also:
Constant Field Values

RECONNECT_FAILURE

static final byte RECONNECT_FAILURE
Reconnect failure. Server response to a client's RECONNECT_REQUEST.
Opcode: 0x22
Payload:

See Also:
Constant Field Values

SESSION_MESSAGE

static final byte SESSION_MESSAGE
Session message. May be sent by the client or the server. Maximum length is 65532 bytes. Larger messages require fragmentation and reassembly above this protocol layer.
Opcode: 0x30
Payload:

See Also:
Constant Field Values

LOGOUT_REQUEST

static final byte LOGOUT_REQUEST
Logout request from a client to a server.
Opcode: 0x40
No payload.

See Also:
Constant Field Values

LOGOUT_SUCCESS

static final byte LOGOUT_SUCCESS
Logout success. Server response to a client's LOGOUT_REQUEST.
Opcode: 0x41
No payload.

See Also:
Constant Field Values

CHANNEL_JOIN

static final byte CHANNEL_JOIN
Channel join. Server notifying a client that it has joined a channel.
Opcode: 0x50
Payload:

See Also:
Constant Field Values

CHANNEL_LEAVE

static final byte CHANNEL_LEAVE
Channel leave. Server notifying a client that it has left a channel.
Opcode: 0x51
Payload:

See Also:
Constant Field Values

CHANNEL_MESSAGE

static final byte CHANNEL_MESSAGE
Channel message. May be sent by the client or the server. Maximum length is 65532 bytes. Larger messages require fragmentation and reassembly above this protocol layer.
Opcode: 0x52
Payload:

See Also:
Constant Field Values

Project Darkstar, Version 0.9.7.2
2013-07-29 20:11:27

Copyright © 2007-2013 Sun Microsystems, Inc. All rights reserved