Ice.Connection¶
- class Ice.Connection¶
Bases:
objectRepresents a connection that uses the Ice protocol.
- close() Awaitable[None]¶
Starts a graceful closure of this connection once all outstanding invocations have completed.
- Returns:
A future that becomes available when the connection is closed.
- Return type:
Awaitable[None]
- createProxy(identity: Ice.Identity) Ice.ObjectPrx¶
Creates a special proxy (a ‘fixed proxy’) that always uses this connection.
- Parameters:
identity (Ice.Identity) – The identity of the target object.
- Returns:
A fixed proxy with the provided identity.
- Return type:
- disableInactivityCheck() None¶
Disables the inactivity check on this connection.
By default, Ice will close connections that remain inactive for a certain period. This function disables that behavior for this connection.
- flushBatchRequests(compress: Ice.CompressBatch) None¶
Flushes any pending batch requests for this connection.
This corresponds to all batch requests invoked on fixed proxies associated with the connection.
- Parameters:
compress (Ice.CompressBatch) – Specifies whether or not the queued batch requests should be compressed before being sent over the wire.
- flushBatchRequestsAsync(compress: Ice.CompressBatch) Awaitable[None]¶
Flushes any pending batch requests for this connection asynchronously.
This corresponds to all batch requests invoked on fixed proxies associated with the connection.
- Parameters:
compress (Ice.CompressBatch) – Specifies whether or not the queued batch requests should be compressed before being sent over the wire.
- Returns:
A future that becomes available when the flush completes.
- Return type:
Awaitable[None]
- getAdapter() Ice.ObjectAdapter | None¶
Gets the object adapter associated with this connection.
- Returns:
The object adapter associated with this connection.
- Return type:
Ice.ObjectAdapter | None
- getEndpoint() Endpoint¶
Gets the endpoint from which the connection was created.
- Returns:
The endpoint from which the connection was created.
- Return type:
- getInfo() Ice.ConnectionInfo¶
Returns the connection information.
- Returns:
The connection information.
- Return type:
- setAdapter(adapter: Ice.ObjectAdapter | None) None¶
Associates an object adapter with this connection.
When a connection receives a request, it dispatches this request using its associated object adapter. If the associated object adapter is
None, the connection rejects any incoming request with anObjectNotExistException.The default object adapter of an incoming connection is the object adapter that created this connection; the default object adapter of an outgoing connection is the communicator’s default object adapter.
- Parameters:
adapter (Ice.ObjectAdapter | None) – The object adapter to associate with this connection.
- setCloseCallback(callback: Callable[[Connection], None]) None¶
Sets 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.
- Parameters:
callback (Callable[[Connection], None]) – The close callback callable.
- throwException() None¶
Raises an exception that provides the reason for the closure of this connection. For example, this function raises
CloseConnectionExceptionwhen the connection was closed gracefully by the peer; it raisesConnectionAbortedExceptionwhen the connection is aborted withabort(). This function does nothing if the connection is not yet closed.