Ice 3.7 Slice API Reference
All Classes Interfaces Structs Exceptions Modules Files Operations Constants Sequences Dictionaries Enumerations Enumerator Pages
Operations | List of all members
Ice::Connection Local Interface 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...
 

Detailed Description

The user-level interface to a connection.

Operation Documentation

◆ close()

["cpp:noexcept","js:async"]
void close ( ConnectionClose  mode)

Manually close the connection using the specified closure mode.

Parameters
modeDetermines how the connection will be closed.
See also
ConnectionClose

◆ createProxy()

["cpp:const","swift:nonnull"]
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.

Parameters
idThe identity for which a proxy is to be created.
Returns
A proxy that matches the given identity and uses this connection.
See also
setAdapter

◆ flushBatchRequests()

["async-oneway"]
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.

Parameters
compressSpecifies whether or not the queued batch requests should be compressed before being sent over the wire.

◆ getACM()

["cpp:noexcept","swift:noexcept"]
ACM getACM ( )

Get the ACM parameters.

Returns
The ACM parameters.

◆ getAdapter()

["cpp:const","cpp:noexcept","swift:noexcept"]
ObjectAdapter getAdapter ( )

Get the object adapter that dispatches requests for this connection.

Returns
The object adapter that dispatches requests for the connection, or null if no adapter is set.
See also
setAdapter

◆ getEndpoint()

["cpp:const","cpp:noexcept","swift:noexcept","swift:nonnull"]
Endpoint getEndpoint ( )

Get the endpoint from which the connection was created.

Returns
The endpoint from which the connection was created.

◆ getInfo()

["cpp:const","swift:nonnull"]
ConnectionInfo getInfo ( )

Returns the connection information.

Returns
The connection information.

◆ heartbeat()

["async-oneway"]
void heartbeat ( )

Send a heartbeat message.

◆ setACM()

["swift:noexcept","java:optional"]
void setACM ( optional(1) int  timeout,
optional(2) ACMClose  close,
optional(3) ACMHeartbeat  heartbeat 
)

Set the active connection management parameters.

Parameters
timeoutThe timeout value in seconds, must be >= 0.
closeThe close condition
heartbeatThe hertbeat condition

◆ setAdapter()

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.

Parameters
adapterThe 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
See also
createProxy
getAdapter

◆ setBufferSize()

void setBufferSize ( int  rcvSize,
int  sndSize 
)

Set the connection buffer receive/send size.

Parameters
rcvSizeThe connection receive buffer size.
sndSizeThe connection send buffer size.

◆ setCloseCallback()

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.

Parameters
callbackThe close callback object.

◆ setHeartbeatCallback()

["swift:noexcept"]
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.

Parameters
callbackThe heartbeat callback object.

◆ throwException()

["cpp:const"]
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.

◆ timeout()

["cpp:const","cpp:noexcept","swift:noexcept"]
int timeout ( )

Get the timeout for the connection.

Returns
The connection's timeout.

◆ toString()

["cpp:const","cpp:noexcept","swift:noexcept"]
string toString ( )

Return a description of the connection as human readable text, suitable for logging or error messages.

Returns
The description of the connection as human readable text.

◆ type()

["cpp:const","cpp:noexcept","swift:noexcept"]
string type ( )

Return the connection type.

This corresponds to the endpoint type, i.e., "tcp", "udp", etc.

Returns
The type of the connection.

The documentation for this interface was generated from the following file: