Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches

◆ close() [2/2]

virtual void Ice::Connection::close ( std::function< void()> response,
std::function< void(std::exception_ptr)> exception )
pure virtualnoexcept

Starts a graceful closure of this connection once all outstanding invocations have completed.

Parameters
responseA callback that the implementation calls when the connection is closed gracefully.
exceptionA callback that the implementation calls when the connection closure failed. Its exception_ptr parameter is always non-null and describes the reason for the failure.
Remarks
The response and exception callbacks may be called synchronously (from the calling thread); in particular, this occurs when you call close on a connection that is already closed. The implementation always calls one of the two callbacks once; it never calls both. If closing the connection takes longer than the configured close timeout, the connection is aborted with a CloseTimeoutException.