![]() |
IPSDK
4_1_0_2
IPSDK : Image Processing Software Development Kit
|
Singleton used for socket pool management. More...
#include <SocketsPool.h>
Public Member Functions | |
| void | init (const LocalNetworkDescription &localNetworkDescription) |
| initializes connections from network description passed as argument, and callback object More... | |
| bool | isInit () const |
| returns true if the object is initialized (ie. init has been called) | |
| void | asyncConnect (const tcpip::Address &remoteAddress) |
| method allowing to connect to a given remote computer More... | |
| void | asyncClose (const Guid &socketGuid) |
| closes connection identified by 'socketGuid' More... | |
| ipUInt64 | asyncDeliver (const SerializationObjectPtr &pObj) |
| delivers the object 'pObj' through all the established connections More... | |
| ipUInt64 | asyncDeliver (const Guid &socketGuid, const SerializationObjectPtr &pObj, const ipsdk::tcpip::DlvCbFun &f=0) |
| delivers the object 'pObj' through the connection identified by 'socketGuid' More... | |
| Guid | addCnxLossCB (const Guid &socketGuid, const tcpip::CnxLossCbFun &f) |
| adds callback function'f' to collection of functions that will automatically be called when the socket 'socketGuid' will be disconnected More... | |
| void | clearCnxLossCB (const Guid &socketGuid) |
| clear callback functions for event "socket 'socketGuid'
disconnected" More... | |
| void | removeCnxLossCB (const Guid &socketGuid, const Guid &cbId) |
| remove callback functions from collection of functions that will automatically called when the socket 'socketGuid' will be disconnected More... | |
| void | clear () |
| boost::optional< tcpip::SocketDesc > | getSocketDesc (const Guid &socketGuid) const |
| returns SocketDesc object associated to identifier 'socketGuid' if 'socketGuid' identifies an existing active connection More... | |
| boost::optional< Guid > | getGuid (const tcpip::Address &remoteAddress) const |
| const tcpip::Address & | getLocalAddress () const |
| retrieve tcpip address informations associated to local computer More... | |
| const SocketsPoolCB & | getSocketsPoolCB () const |
| retrieve socket pool callback More... | |
| SocketsPoolCB & | getSocketsPoolCB () |
| retrieve socket pool callback More... | |
Static Public Member Functions | |
| static SocketsPool & | getInstance () |
| retrieve single instance of object | |
Protected Member Functions | |
Constructors and destructors | |
| SocketsPool () | |
| ~SocketsPool () | |
Protected Attributes | |
| tcpip::CollPeersPtr | _pCollPeers |
| pointer to implementation object | |
| boost::shared_ptr< SocketsPoolCB > | _pSocketsPoolCB |
| pointer to used call back object | |
| tcpip::Address | _localAddress |
| tcpip address informations associated to local computer | |
| ipUInt16 | _portNumber |
| used socket port number | |
Singleton used for socket pool management.
| void ipsdk::core::SocketsPool::init | ( | const LocalNetworkDescription & | localNetworkDescription | ) |
initializes connections from network description passed as argument, and callback object
| ipsdk::core::IPSDKCoreException | if remote processing license feature is not available |
| const SocketsPoolCB& ipsdk::core::SocketsPool::getSocketsPoolCB | ( | ) | const |
retrieve socket pool callback
| ipsdk::core::IPSDKCoreException | if isInit() == false |
| SocketsPoolCB& ipsdk::core::SocketsPool::getSocketsPoolCB | ( | ) |
retrieve socket pool callback
| ipsdk::core::IPSDKCoreException | if isInit() == false |
| void ipsdk::core::SocketsPool::asyncConnect | ( | const tcpip::Address & | remoteAddress | ) |
method allowing to connect to a given remote computer
| ipsdk::core::IPSDKCoreException | if isInit() == false |
| void ipsdk::core::SocketsPool::asyncClose | ( | const Guid & | socketGuid | ) |
closes connection identified by 'socketGuid'
| socketGuid | identifier of the connection |
| ipsdk::core::IPSDKCoreException | if isInit() == false |
| ipUInt64 ipsdk::core::SocketsPool::asyncDeliver | ( | const SerializationObjectPtr & | pObj | ) |
delivers the object 'pObj' through all the established connections
| pObj | object to send |
| ipsdk::core::IPSDKCoreException | if isInit() == false |
| ipUInt64 ipsdk::core::SocketsPool::asyncDeliver | ( | const Guid & | socketGuid, |
| const SerializationObjectPtr & | pObj, | ||
| const ipsdk::tcpip::DlvCbFun & | f = 0 |
||
| ) |
delivers the object 'pObj' through the connection identified by 'socketGuid'
| socketGuid | identifier of the connection |
| pObj | object to send |
| f | callback function to call once the delivery operation is complete (optional) |
| ipsdk::core::IPSDKCoreException | if isInit() == false |
| Guid ipsdk::core::SocketsPool::addCnxLossCB | ( | const Guid & | socketGuid, |
| const tcpip::CnxLossCbFun & | f | ||
| ) |
adds callback function'f' to collection of functions that will automatically be called when the socket 'socketGuid' will be disconnected
| socketGuid | socket unique id |
| f | callback function |
| ipsdk::core::IPSDKCoreException | if isInit() == false |
| void ipsdk::core::SocketsPool::clearCnxLossCB | ( | const Guid & | socketGuid | ) |
clear callback functions for event "socket 'socketGuid' disconnected"
| socketGuid | socket unique id |
| ipsdk::core::IPSDKCoreException | if isInit() == false |
remove callback functions from collection of functions that will automatically called when the socket 'socketGuid' will be disconnected
| socketGuid | socket unique id |
| cbId | callback function id, returned by addCnxLossCB method |
| ipsdk::core::IPSDKCoreException | if isInit() == false |
| void ipsdk::core::SocketsPool::clear | ( | ) |
if isInit()==true, close all opened connections and wait for all the threads to terminate
| boost::optional<tcpip::SocketDesc> ipsdk::core::SocketsPool::getSocketDesc | ( | const Guid & | socketGuid | ) | const |
returns SocketDesc object associated to identifier 'socketGuid' if 'socketGuid' identifies an existing active connection
| socketGuid | unique identifier of the connection |
| ipsdk::core::IPSDKCoreException | if isInit() == false |
| boost::optional<Guid> ipsdk::core::SocketsPool::getGuid | ( | const tcpip::Address & | remoteAddress | ) | const |
| remoteAddress | remote address informations |
| ipsdk::core::IPSDKCoreException | if isInit() == false |
| const tcpip::Address& ipsdk::core::SocketsPool::getLocalAddress | ( | ) | const |
retrieve tcpip address informations associated to local computer
| ipsdk::core::IPSDKCoreException | if isInit() == false |
1.8.14