Ice 3.7 Slice API Reference
|
The user-level interface to a connection. More...
defined in <Ice/Connection.ice>
["swift:inherits:Swift.CustomStringConvertible"]
local interface Connection { ... }
Operations | |
void | close (ConnectionClose mode) |
Manually close the connection using the specified closure mode. More... | |
Object * | createProxy (Identity id) |
Create a special proxy that always uses this connection. More... | |
void | flushBatchRequests (CompressBatch compress) |
Flush any pending batch requests for this connection. More... | |
ACM | getACM () |
Get the ACM parameters. More... | |
ObjectAdapter | getAdapter () |
Get the object adapter that dispatches requests for this connection. More... | |
Endpoint | getEndpoint () |
Get the endpoint from which the connection was created. More... | |
ConnectionInfo | getInfo () |
Returns the connection information. More... | |
void | heartbeat () |
Send a heartbeat message. More... | |
void | setACM (optional(1) int timeout, optional(2) ACMClose close, optional(3) ACMHeartbeat heartbeat) |
Set the active connection management parameters. More... | |
void | setAdapter (ObjectAdapter adapter) |
Explicitly set an object adapter that dispatches requests that are received over this connection. More... | |
void | setBufferSize (int rcvSize, int sndSize) |
Set the connection buffer receive/send size. More... | |
void | setCloseCallback (CloseCallback callback) |
Set a close callback on the connection. More... | |
void | setHeartbeatCallback (HeartbeatCallback callback) |
Set a heartbeat callback on the connection. More... | |
void | throwException () |
Throw an exception indicating the reason for connection closure. More... | |
int | timeout () |
Get the timeout for the connection. More... | |
string | toString () |
Return a description of the connection as human readable text, suitable for logging or error messages. More... | |
string | type () |
Return the connection type. More... | |
The user-level interface to a connection.
void close | ( | ConnectionClose | mode | ) |
Manually close the connection using the specified closure mode.
mode | Determines how the connection will be closed. |
Object* createProxy | ( | Identity | id | ) |
Create a special proxy that always uses this connection.
This can be used for callbacks from a server to a client if the server cannot directly establish a connection to the client, for example because of firewalls. In this case, the server would create a proxy using an already established connection from the client.
id | The identity for which a proxy is to be created. |
void flushBatchRequests | ( | CompressBatch | compress | ) |
Flush any pending batch requests for this connection.
This means all batch requests invoked on fixed proxies associated with the connection.
compress | Specifies whether or not the queued batch requests should be compressed before being sent over the wire. |
ObjectAdapter getAdapter | ( | ) |
Get the object adapter that dispatches requests for this connection.
Endpoint getEndpoint | ( | ) |
Get the endpoint from which the connection was created.
ConnectionInfo getInfo | ( | ) |
Returns the connection information.
void heartbeat | ( | ) |
Send a heartbeat message.
void setACM | ( | optional(1) int | timeout, |
optional(2) ACMClose | close, | ||
optional(3) ACMHeartbeat | heartbeat | ||
) |
Set the active connection management parameters.
timeout | The timeout value in seconds, must be >= 0. |
close | The close condition |
heartbeat | The hertbeat condition |
void setAdapter | ( | ObjectAdapter | adapter | ) |
Explicitly set an object adapter that dispatches requests that are received over this connection.
A client can invoke an operation on a server using a proxy, and then set an object adapter for the outgoing connection that is used by the proxy in order to receive callbacks. This is useful if the server cannot establish a connection back to the client, for example because of firewalls.
adapter | The object adapter that should be used by this connection to dispatch requests. The object adapter must be activated. When the object adapter is deactivated, it is automatically removed from the connection. Attempts to use a deactivated object adapter raise ObjectAdapterDeactivatedException |
void setBufferSize | ( | int | rcvSize, |
int | sndSize | ||
) |
Set the connection buffer receive/send size.
rcvSize | The connection receive buffer size. |
sndSize | The connection send buffer size. |
void setCloseCallback | ( | CloseCallback | callback | ) |
Set a close callback on the connection.
The callback is called by the connection when it's closed. The callback is called from the Ice thread pool associated with the connection. If the callback needs more information about the closure, it can call Connection#throwException.
callback | The close callback object. |
void setHeartbeatCallback | ( | HeartbeatCallback | callback | ) |
Set a heartbeat callback on the connection.
The callback is called by the connection when a heartbeat is received. The callback is called from the Ice thread pool associated with the connection.
callback | The heartbeat callback object. |
void throwException | ( | ) |
Throw an exception indicating the reason for connection closure.
For example, CloseConnectionException is raised if the connection was closed gracefully, whereas ConnectionManuallyClosedException is raised if the connection was manually closed by the application. This operation does nothing if the connection is not yet closed.
int timeout | ( | ) |
Get the timeout for the connection.
string toString | ( | ) |
Return a description of the connection as human readable text, suitable for logging or error messages.
string type | ( | ) |
Return the connection type.
This corresponds to the endpoint type, i.e., "tcp", "udp", etc.