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
Encoding for Proxy Fields
The encoding format of proxies changed in version 1.1.
Proxy Encoding Version 1.0
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:
struct ProxyData{ Ice::Identity id; Ice::StringSeq facet; byte mode; bool secure;}The proxy fields are described in the table below:
| Field | Description |
|---|---|
id | The object identity |
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.
Proxy Encoding Version 1.1
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:
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:
| Field | Description |
|---|---|
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.
Encoding for Endpoints
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.
Encoding for TCP Endpoints
A TCP endpoint is encoded as an encapsulation containing the following structure:
struct TCPEndpointData{ string host; int port; int timeout; bool compress;}The endpoint fields are described in the following table.
| Field | Description |
|---|---|
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 |
Encoding for UDP Endpoints
The encoding format of UDP endpoints changed in version 1.1.
UDP Endpoint Encoding Version 1.0
A UDP endpoint is encoded as an encapsulation containing the following structure:
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.
| Field | Description |
|---|---|
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 |
The four version fields are ignored when the endpoint is unmarshaled. They are kept for backwards compatibility.
UDP Endpoint Encoding Version 1.1
Version 1.1 of the encoding omits the protocol and encoding versions because these fields are handled as proxy fields instead:
struct UDPEndpointData{ string host; int port; bool compress;}The endpoint fields are described in the following table.
| Field | Description |
|---|---|
host | The server host (a host name or IP address) |
port | The server port ( 1-65535) |
compress |
Encoding for SSL Endpoints
An SSL endpoint is encoded as an encapsulation containing the following structure:
struct SSLEndpointData{ string host; int port; int timeout; bool compress;}The endpoint fields are described in the following table.
| Field | Description |
|---|---|
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 |
Encoding for WS Endpoints
A WebSocket endpoint is encoded as an encapsulation containing the following structure:
struct WSEndpointData{ string host; int port; int timeout; bool compress; string resource;}The endpoint fields are described in the following table.
| Field | Description |
|---|---|
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 | |
resource | A URI representing the web server resource associated with this endpoint |
Encoding for WSS Endpoints
A secure WebSocket endpoint is encoded as an encapsulation containing the following structure:
struct WSSEndpointData{ string host; int port; int timeout; bool compress; string resource;}The endpoint fields are described in the following table.
| Field | Description |
|---|---|
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 | |
resource | A URI representing the web server resource associated with this endpoint |
Encoding for BT Endpoints
A Bluetooth endpoint is encoded as an encapsulation containing the following structure:
struct BTEndpointData{ string addr; string uuid; int timeout; bool compress;}The endpoint fields are described in the following table.
| Field | Description |
|---|---|
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 |
Encoding for BTS Endpoints
A secure Bluetooth endpoint is encoded as an encapsulation containing the following structure:
struct BTSEndpointData{ string addr; string uuid; int timeout; bool compress;}The endpoint fields are described in the following table.
| Field | Description |
|---|---|
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 |
Encoding for iAP Endpoints
An iAP endpoint is encoded as an encapsulation containing the following structure:
struct IAPEndpointData{ string manufacturer; string modelNumber; string name; string protocol; int timeout; bool compress;}The endpoint fields are described in the following table.
| Field | Description |
|---|---|
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 |
Encoding for iAPS Endpoints
A secure iAP endpoint is encoded as an encapsulation containing the following structure:
struct IAPSEndpointData{ string manufacturer; string modelNumber; string name; string protocol; int timeout; bool compress;}The endpoint fields are described in the following table.
| Field | Description |
|---|---|
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 |