Ice 3.7 C++11 API Reference
|
The user-level interface to a connection. More...
#include <Ice/Ice.h>
Public Member Functions | |
virtual void | close (ConnectionClose mode) noexcept=0 |
Manually close the connection using the specified closure mode. More... | |
virtual ::std::shared_ptr<::Ice::ObjectPrx > | createProxy (const Identity &id) const =0 |
Create a special proxy that always uses this connection. More... | |
virtual void | flushBatchRequests (CompressBatch compress) |
Flush any pending batch requests for this connection. More... | |
template<template< typename > class P = ::std::promise> | |
auto | flushBatchRequestsAsync (CompressBatch compress) -> decltype(::std::declval< P< void >>().get_future()) |
Flush any pending batch requests for this connection. More... | |
virtual ::std::function< void()> | flushBatchRequestsAsync (CompressBatch compress, ::std::function< void(::std::exception_ptr)> exception, ::std::function< void(bool)> sent=nullptr)=0 |
Flush any pending batch requests for this connection. More... | |
virtual ::Ice::ACM | getACM () noexcept=0 |
Get the ACM parameters. More... | |
virtual ::std::shared_ptr<::Ice::ObjectAdapter > | getAdapter () const noexcept=0 |
Get the object adapter that dispatches requests for this connection. More... | |
virtual ::std::shared_ptr<::Ice::Endpoint > | getEndpoint () const noexcept=0 |
Get the endpoint from which the connection was created. More... | |
virtual ::std::shared_ptr<::Ice::ConnectionInfo > | getInfo () const =0 |
Returns the connection information. More... | |
virtual void | heartbeat () |
Send a heartbeat message. More... | |
template<template< typename > class P = ::std::promise> | |
auto | heartbeatAsync () -> decltype(::std::declval< P< void >>().get_future()) |
Send a heartbeat message. More... | |
virtual ::std::function< void()> | heartbeatAsync (::std::function< void(::std::exception_ptr)> exception, ::std::function< void(bool)> sent=nullptr)=0 |
Send a heartbeat message. More... | |
virtual void | setACM (const Ice::optional< int > &timeout, const Ice::optional< ACMClose > &close, const Ice::optional< ACMHeartbeat > &heartbeat)=0 |
Set the active connection management parameters. More... | |
virtual void | setAdapter (const ::std::shared_ptr< ObjectAdapter > &adapter)=0 |
Explicitly set an object adapter that dispatches requests that are received over this connection. More... | |
virtual void | setBufferSize (int rcvSize, int sndSize)=0 |
Set the connection buffer receive/send size. More... | |
virtual void | setCloseCallback (CloseCallback callback)=0 |
Set a close callback on the connection. More... | |
virtual void | setHeartbeatCallback (HeartbeatCallback callback)=0 |
Set a heartbeat callback on the connection. More... | |
virtual void | throwException () const =0 |
Throw an exception indicating the reason for connection closure. More... | |
virtual int | timeout () const noexcept=0 |
Get the timeout for the connection. More... | |
virtual ::std::string | toString () const noexcept=0 |
Return a description of the connection as human readable text, suitable for logging or error messages. More... | |
virtual ::std::string | type () const noexcept=0 |
Return the connection type. More... | |
virtual | ~Connection () |
The user-level interface to a connection.
|
virtual |
|
pure virtualnoexcept |
Manually close the connection using the specified closure mode.
mode | Determines how the connection will be closed. |
|
pure virtual |
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. |
|
inlinevirtual |
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. |
|
inline |
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. |
|
pure virtual |
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. |
exception | The exception callback. |
sent | The sent callback. |
|
pure virtualnoexcept |
|
pure virtualnoexcept |
Get the object adapter that dispatches requests for this connection.
|
pure virtualnoexcept |
Get the endpoint from which the connection was created.
|
pure virtual |
Returns the connection information.
|
inlinevirtual |
Send a heartbeat message.
|
inline |
Send a heartbeat message.
|
pure virtual |
Send a heartbeat message.
exception | The exception callback. |
sent | The sent callback. |
|
pure virtual |
Set the active connection management parameters.
timeout | The timeout value in seconds, must be >= 0. |
close | The close condition |
heartbeat | The hertbeat condition |
|
pure virtual |
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 |
|
pure virtual |
Set the connection buffer receive/send size.
rcvSize | The connection receive buffer size. |
sndSize | The connection send buffer size. |
|
pure virtual |
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. |
|
pure virtual |
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. |
|
pure virtual |
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.
|
pure virtualnoexcept |
Get the timeout for the connection.
|
pure virtualnoexcept |
Return a description of the connection as human readable text, suitable for logging or error messages.
|
pure virtualnoexcept |
Return the connection type.
This corresponds to the endpoint type, i.e., "tcp", "udp", etc.