Ice 3.7 C++98 API Reference
Loading...
Searching...
No Matches
Ice::Connection Class Referenceabstract

The user-level interface to a connection. More...

#include <Ice/Ice.h>

Inheritance diagram for Ice::Connection:
Collaboration diagram for Ice::Connection:

Public Types

typedef ConnectionPtr PointerType

Public Member Functions

virtual AsyncResultPtr begin_flushBatchRequests (CompressBatch compress)=0
 Flush any pending batch requests for this connection.
virtual AsyncResultPtr begin_flushBatchRequests (CompressBatch compress, const Callback_Connection_flushBatchRequestsPtr &cb, const LocalObjectPtr &cookie=0)=0
 Flush any pending batch requests for this connection.
virtual AsyncResultPtr begin_flushBatchRequests (CompressBatch compress, const CallbackPtr &cb, const LocalObjectPtr &cookie=0)=0
 Flush any pending batch requests for this connection.
virtual AsyncResultPtr begin_heartbeat ()=0
 Send a heartbeat message.
virtual AsyncResultPtr begin_heartbeat (const Callback_Connection_heartbeatPtr &cb, const LocalObjectPtr &cookie=0)=0
 Send a heartbeat message.
virtual AsyncResultPtr begin_heartbeat (const CallbackPtr &cb, const LocalObjectPtr &cookie=0)=0
 Send a heartbeat message.
virtual void close (ConnectionClose mode) throw () =0
 Manually close the connection using the specified closure mode.
virtual ObjectPrx createProxy (const Identity &id) const =0
 Create a special proxy that always uses this connection.
virtual void end_flushBatchRequests (const AsyncResultPtr &result)=0
 Flush any pending batch requests for this connection.
virtual void end_heartbeat (const AsyncResultPtr &result)=0
 Send a heartbeat message.
virtual void flushBatchRequests (CompressBatch compress)=0
 Flush any pending batch requests for this connection.
virtual ACM getACM () throw () =0
 Get the ACM parameters.
virtual ObjectAdapterPtr getAdapter () const throw () =0
 Get the object adapter that dispatches requests for this connection.
virtual EndpointPtr getEndpoint () const throw () =0
 Get the endpoint from which the connection was created.
virtual ConnectionInfoPtr getInfo () const =0
 Returns the connection information.
virtual void heartbeat ()=0
 Send a heartbeat message.
virtual void setACM (const IceUtil::Optional< Int > &timeout, const IceUtil::Optional< ACMClose > &close, const IceUtil::Optional< ACMHeartbeat > &heartbeat)=0
 Set the active connection management parameters.
virtual void setAdapter (const ObjectAdapterPtr &adapter)=0
 Explicitly set an object adapter that dispatches requests that are received over this connection.
virtual void setBufferSize (Int rcvSize, Int sndSize)=0
 Set the connection buffer receive/send size.
virtual void setCloseCallback (const CloseCallbackPtr &callback)=0
 Set a close callback on the connection.
virtual void setHeartbeatCallback (const HeartbeatCallbackPtr &callback)=0
 Set a heartbeat callback on the connection.
virtual void throwException () const =0
 Throw an exception indicating the reason for connection closure.
virtual Int timeout () const throw () =0
 Get the timeout for the connection.
virtual::std::string toString () const throw () =0
 Return a description of the connection as human readable text, suitable for logging or error messages.
virtual::std::string type () const throw () =0
 Return the connection type.
virtual ~Connection ()
Public Member Functions inherited from Ice::LocalObject
virtual bool operator< (const LocalObject &) const
virtual bool operator== (const LocalObject &) const
Public Member Functions inherited from IceUtil::Shared
void __clearFlag (unsigned char flag)
virtual void __decRef ()
virtual int __getRef () const
bool __hasFlag (unsigned char flag)
virtual void __incRef ()
void __setFlag (unsigned char flag)
virtual void __setNoDelete (bool)
Sharedoperator= (const Shared &)
 Shared ()
 Shared (const Shared &)
virtual ~Shared ()

Additional Inherited Members

Static Public Attributes inherited from IceUtil::Shared
static const unsigned char NoDelete
Protected Attributes inherited from IceUtil::Shared
unsigned char _flags
IceUtilInternal::Atomic _ref

Detailed Description

The user-level interface to a connection.

Member Typedef Documentation

◆ PointerType

Constructor & Destructor Documentation

◆ ~Connection()

virtual Ice::Connection::~Connection ( )
virtual

Member Function Documentation

◆ begin_flushBatchRequests() [1/3]

virtual AsyncResultPtr Ice::Connection::begin_flushBatchRequests ( CompressBatch compress)
pure virtual

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.
Returns
The asynchronous result object for the invocation.

◆ begin_flushBatchRequests() [2/3]

virtual AsyncResultPtr Ice::Connection::begin_flushBatchRequests ( CompressBatch compress,
const Callback_Connection_flushBatchRequestsPtr & cb,
const LocalObjectPtr & cookie = 0 )
pure virtual

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.
cbCallback to be invoked when the invocation completes
cookieExtra data to associate with the invocation.
Returns
The asynchronous result object for the invocation.

◆ begin_flushBatchRequests() [3/3]

virtual AsyncResultPtr Ice::Connection::begin_flushBatchRequests ( CompressBatch compress,
const CallbackPtr & cb,
const LocalObjectPtr & cookie = 0 )
pure virtual

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.
cbCallback to be invoked when the invocation completes
cookieExtra data to associate with the invocation.
Returns
The asynchronous result object for the invocation.

◆ begin_heartbeat() [1/3]

virtual AsyncResultPtr Ice::Connection::begin_heartbeat ( )
pure virtual

Send a heartbeat message.

Returns
The asynchronous result object for the invocation.

◆ begin_heartbeat() [2/3]

virtual AsyncResultPtr Ice::Connection::begin_heartbeat ( const Callback_Connection_heartbeatPtr & cb,
const LocalObjectPtr & cookie = 0 )
pure virtual

Send a heartbeat message.

Parameters
cbCallback to be invoked when the invocation completes
cookieExtra data to associate with the invocation.
Returns
The asynchronous result object for the invocation.

◆ begin_heartbeat() [3/3]

virtual AsyncResultPtr Ice::Connection::begin_heartbeat ( const CallbackPtr & cb,
const LocalObjectPtr & cookie = 0 )
pure virtual

Send a heartbeat message.

Parameters
cbCallback to be invoked when the invocation completes
cookieExtra data to associate with the invocation.
Returns
The asynchronous result object for the invocation.

◆ close()

virtual void Ice::Connection::close ( ConnectionClose mode)
throw ( )
pure virtual

Manually close the connection using the specified closure mode.

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

◆ createProxy()

virtual ObjectPrx Ice::Connection::createProxy ( const Identity & id) const
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.

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

◆ end_flushBatchRequests()

virtual void Ice::Connection::end_flushBatchRequests ( const AsyncResultPtr & result)
pure virtual

Flush any pending batch requests for this connection.

This means all batch requests invoked on fixed proxies associated with the connection.

Parameters
resultThe asynchronous result object returned by the begin_ method.

◆ end_heartbeat()

virtual void Ice::Connection::end_heartbeat ( const AsyncResultPtr & result)
pure virtual

Send a heartbeat message.

Parameters
resultThe asynchronous result object returned by the begin_ method.

◆ flushBatchRequests()

virtual void Ice::Connection::flushBatchRequests ( CompressBatch compress)
pure virtual

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()

virtual ACM Ice::Connection::getACM ( )
throw ( )
pure virtual

Get the ACM parameters.

Returns
The ACM parameters.

◆ getAdapter()

virtual ObjectAdapterPtr Ice::Connection::getAdapter ( ) const
throw ( )
pure virtual

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()

virtual EndpointPtr Ice::Connection::getEndpoint ( ) const
throw ( )
pure virtual

Get the endpoint from which the connection was created.

Returns
The endpoint from which the connection was created.

◆ getInfo()

virtual ConnectionInfoPtr Ice::Connection::getInfo ( ) const
pure virtual

Returns the connection information.

Returns
The connection information.

◆ heartbeat()

virtual void Ice::Connection::heartbeat ( )
pure virtual

Send a heartbeat message.

◆ setACM()

virtual void Ice::Connection::setACM ( const IceUtil::Optional< Int > & timeout,
const IceUtil::Optional< ACMClose > & close,
const IceUtil::Optional< ACMHeartbeat > & heartbeat )
pure virtual

Set the active connection management parameters.

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

◆ setAdapter()

virtual void Ice::Connection::setAdapter ( const ObjectAdapterPtr & adapter)
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.

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()

virtual void Ice::Connection::setBufferSize ( Int rcvSize,
Int sndSize )
pure virtual

Set the connection buffer receive/send size.

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

◆ setCloseCallback()

virtual void Ice::Connection::setCloseCallback ( const CloseCallbackPtr & callback)
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.

Parameters
callbackThe close callback object.

◆ setHeartbeatCallback()

virtual void Ice::Connection::setHeartbeatCallback ( const HeartbeatCallbackPtr & callback)
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.

Parameters
callbackThe heartbeat callback object.

◆ throwException()

virtual void Ice::Connection::throwException ( ) const
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.

◆ timeout()

virtual Int Ice::Connection::timeout ( ) const
throw ( )
pure virtual

Get the timeout for the connection.

Returns
The connection's timeout.

◆ toString()

virtual::std::string Ice::Connection::toString ( ) const
throw ( )
pure virtual

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()

virtual::std::string Ice::Connection::type ( ) const
throw ( )
pure virtual

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 class was generated from the following file: