Data Encoding for Proxies

11 min read

11 min read

11 min read

11 min read

11 min read

11 min read

11 min read

11 min read

11 min read

The encoding format of proxies changed in version 1.1.

The first component of a marshaled proxy is a value of type Ice::Identity. If the proxy is a null value, the category and name fields are empty strings, and no additional data is marshaled. The encoding for a non-null proxy consists of proxy fields followed by endpoints.

The proxy fields are encoded as if they were fields of the following structure:

Slice
struct ProxyData
{
Ice::Identity id;
Ice::StringSeq facet;
byte mode;
bool secure;
}

The proxy fields are described in the table below:

FieldDescription
id
facet
The facet name (zero- or one-element sequence)
mode
The proxy mode (0=twoway, 1=oneway, 2=batch oneway, 3=datagram, 4=batch datagram)
secure
Ignored. Kept for backwards compatibility.

The facet field has either zero elements or one element. An empty sequence denotes the default facet, and a one-element sequence provides the facet name.

Version 1.1 of the encoding adds two fields to the existing proxy fields in version 1.0: protocol and encoding versions. The proxy fields are encoded as if they were fields of the following structure:

Slice
struct ProtocolVersion
{
byte major;
byte minor;
}
struct EncodingVersion
{
byte major;
byte minor;
}
struct ProxyData
{
Ice::Identity id;
Ice::StringSeq facet;
byte mode;
bool secure;
ProtocolVersion protocol;
EncodingVersion encoding;
}

The additional fields are described in the table below:

FieldDescription
protocol
The protocol version of the proxy: 1.0 for the Ice protocol.
encoding
The encoding version used to marshal the parameters of requests sent using this proxy.

The encoding for UDP endpoints also changed in version 1.1.

The proxy fields are followed by a size, the number of endpoints, and then by the endpoints or, when this size is 0, by the adapter ID encoded as a string. The adapter ID is the empty string for a well-known proxy.

Each endpoint is encoded as a short, the endpoint type, followed by an encapsulation of the type-specific fields described in the sections that follow.

A TCP endpoint is encoded as an encapsulation containing the following structure:

Slice
struct TCPEndpointData
{
string host;
int port;
int timeout;
bool compress;
}

The endpoint fields are described in the following table.

FieldDescription
host
The server host (a host name or IP address)
port
The server port (1-65535)
timeout
The timeout in milliseconds for socket operations. This field is no longer used but is kept for backwards compatibility.
compress
true if compression should be used (if possible), otherwise false

The encoding format of UDP endpoints changed in version 1.1.

A UDP endpoint is encoded as an encapsulation containing the following structure:

Slice
struct UDPEndpointData
{
string host;
int port;
byte protocolMajor;
byte protocolMinor;
byte encodingMajor;
byte encodingMinor;
bool compress;
}

The endpoint fields are described in the following table.

FieldDescription
host
The server host (a host name or IP address)
port
The server port (1-65535)
protocolMajor
Always 1
protocolMinor
Always 0
encodingMajor
Always 1
encodingMinor
Always 0
compress
true if compression should be used (if possible), otherwise false

The four version fields are ignored when the endpoint is unmarshaled. They are kept for backwards compatibility.

Version 1.1 of the encoding omits the protocol and encoding versions because these fields are handled as proxy fields instead:

Slice
struct UDPEndpointData
{
string host;
int port;
bool compress;
}

The endpoint fields are described in the following table.

FieldDescription
host
The server host (a host name or IP address)
port
The server port (1-65535)
compress
true if compression should be used (if possible), otherwise false

An SSL endpoint is encoded as an encapsulation containing the following structure:

Slice
struct SSLEndpointData
{
string host;
int port;
int timeout;
bool compress;
}

The endpoint fields are described in the following table.

FieldDescription
host
The server host (a host name or IP address)
port
The server port (1-65535)
timeout
The timeout in milliseconds for socket operations. This field is no longer used but is kept for backwards compatibility.
compress
true if compression should be used (if possible), otherwise false

A WebSocket endpoint is encoded as an encapsulation containing the following structure:

Slice
struct WSEndpointData
{
string host;
int port;
int timeout;
bool compress;
string resource;
}

The endpoint fields are described in the following table.

FieldDescription
host
The server host (a host name or IP address)
port
The server port (1-65535)
timeout
The timeout in milliseconds for socket operations. This field is no longer used but is kept for backwards compatibility.
compress
true if compression should be used (if possible), otherwise false
resource
A URI representing the web server resource associated with this endpoint

A secure WebSocket endpoint is encoded as an encapsulation containing the following structure:

Slice
struct WSSEndpointData
{
string host;
int port;
int timeout;
bool compress;
string resource;
}

The endpoint fields are described in the following table.

FieldDescription
host
The server host (a host name or IP address)
port
The server port (1-65535)
timeout
The timeout in milliseconds for socket operations. This field is no longer used but is kept for backwards compatibility.
compress
true if compression should be used (if possible), otherwise false
resource
A URI representing the web server resource associated with this endpoint

A Bluetooth endpoint is encoded as an encapsulation containing the following structure:

Slice
struct BTEndpointData
{
string addr;
string uuid;
int timeout;
bool compress;
}

The endpoint fields are described in the following table.

FieldDescription
addr
The Bluetooth address of the server
uuid
The UUID of the target service
timeout
The timeout in milliseconds for socket operations. This field is no longer used but is kept for backwards compatibility.
compress
true if compression should be used (if possible), otherwise false

A secure Bluetooth endpoint is encoded as an encapsulation containing the following structure:

Slice
struct BTSEndpointData
{
string addr;
string uuid;
int timeout;
bool compress;
}

The endpoint fields are described in the following table.

FieldDescription
addr
The Bluetooth address of the server
uuid
The UUID of the target service
timeout
The timeout in milliseconds for socket operations. This field is no longer used but is kept for backwards compatibility.
compress
true if compression should be used (if possible), otherwise false

An iAP endpoint is encoded as an encapsulation containing the following structure:

Slice
struct IAPEndpointData
{
string manufacturer;
string modelNumber;
string name;
string protocol;
int timeout;
bool compress;
}

The endpoint fields are described in the following table.

FieldDescription
manufacturer
The accessory manufacturer
modelNumber
The accessory model number
name
The accessory name
protocol
The protocol implemented by the accessory
timeout
The timeout in milliseconds for socket operations. This field is no longer used but is kept for backwards compatibility.
compress
true if compression should be used (if possible), otherwise false

A secure iAP endpoint is encoded as an encapsulation containing the following structure:

Slice
struct IAPSEndpointData
{
string manufacturer;
string modelNumber;
string name;
string protocol;
int timeout;
bool compress;
}

The endpoint fields are described in the following table.

FieldDescription
manufacturer
The accessory manufacturer
modelNumber
The accessory model number
name
The accessory name
protocol
The protocol implemented by the accessory
timeout
The timeout in milliseconds for socket operations. This field is no longer used but is kept for backwards compatibility.
compress
true if compression should be used (if possible), otherwise false