IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ipsdk::core::SocketsPoolCB Class Reference

callback class, whose methods are automatically called each time an event associated to the attached SocketsPool occurs More...

#include <SocketsPoolCB.h>

Inheritance diagram for ipsdk::core::SocketsPoolCB:
ipsdk::tcpip::CollPeersCB

Public Member Functions

bool isInit () const
 retrieve object initialization flag
 
void init (const LocalNetworkDescription &localNetworkDescription)
 object initialization method
 
const LocalNetworkDescriptiongetLocalNetworkDescription () const
 retrieve local network descriptin associated to callback More...
 
BoolResult waitForEndOfInit (const boost::chrono::milliseconds &duration) const
 method allowing to wait for initialization termination More...
 
Constructors and destructors
 SocketsPoolCB ()
 
 ~SocketsPoolCB ()
 
- Public Member Functions inherited from ipsdk::tcpip::CollPeersCB
 CollPeersCB ()
 
virtual ~CollPeersCB ()
 

Protected Member Functions

void onConnected (const tcpip::SocketDesc &socketDesc)
 method called each time a new incoming connection is accepted, or an outcoming connection is established More...
 
void onListenFailed (ipUInt16 acceptorId, const boost::system::error_code &ec)
 method called when an incoming connection is refused, or when a listen operation is aborted More...
 
void onConnectionFailed (const Guid &socketGuid, const tcpip::EndPoint &remoteEndPoint, const boost::system::error_code &ec)
 method called when an outcoming connection request fails More...
 
void onDeliveryFailed (const Guid &socketGuid, ipUInt64 nDeliveryId)
 method called each time a delivery request fails More...
 
void onDelivered (const tcpip::SocketDesc &socketDesc, ipUInt64 nDeliveryId)
 method called each time a delivery request succeeds More...
 
void simpleActionThread (const tcpip::SocketDesc &socketDesc, const ActionPtr &pAction)
 
void onRead (const tcpip::SocketDesc &socketDesc, const SerializationObjectPtr pObj)
 method called each time a new object has been read through a connection More...
 
void onConnectionLost (const tcpip::SocketDesc &socketDesc, const boost::system::error_code &ec)
 method called each time an active connection is broken More...
 
void onConnectionClosed (const Guid &socketGuid, bool bOnUserRequest)
 method called when a connection is closed (follows a server connection break, or a user close request) More...
 
void notifyConnection (const tcpip::Address &remoteAddress, const AddressColl &slavesAddressColl)
 method allowing to notify for remote computer connection Remote computer provides its collection of slave ip addresses More...
 

Protected Attributes

LocalNetworkDescriptionPtr _pLocalNetworkDescription
 network description associated to local computer
 
AddressColl _globalAddressColl
 collection of all known ip addresses
 
AddressColl _pendingAddressColl
 collection of expected ip address connections still pending
 
AddressColl _unexpectedAddressColl
 collection of unexpected ip address connections
 
boost::mutex _mutex
 mutex used for concurrent accesses protection
 
boost::condition_variable _condition
 
bool _bInit
 object initialization flag
 

Friends

class RegisterComputerInfo
 

Detailed Description

callback class, whose methods are automatically called each time an event associated to the attached SocketsPool occurs

Author
H. Delestre
Date
2013/12/6

Member Function Documentation

◆ getLocalNetworkDescription()

const LocalNetworkDescription& ipsdk::core::SocketsPoolCB::getLocalNetworkDescription ( ) const

retrieve local network descriptin associated to callback

Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false

◆ waitForEndOfInit()

BoolResult ipsdk::core::SocketsPoolCB::waitForEndOfInit ( const boost::chrono::milliseconds &  duration) const

method allowing to wait for initialization termination

Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false

◆ onConnected()

void ipsdk::core::SocketsPoolCB::onConnected ( const tcpip::SocketDesc socketDesc)
protectedvirtual

method called each time a new incoming connection is accepted, or an outcoming connection is established

Parameters
socketDescdescription of the connection (id. + endpoints)
Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false

Reimplemented from ipsdk::tcpip::CollPeersCB.

◆ onListenFailed()

void ipsdk::core::SocketsPoolCB::onListenFailed ( ipUInt16  acceptorId,
const boost::system::error_code &  ec 
)
protectedvirtual

method called when an incoming connection is refused, or when a listen operation is aborted

Parameters
acceptorIdlisten port on which the connection has been refused
eccause of the error
Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false

Reimplemented from ipsdk::tcpip::CollPeersCB.

◆ onConnectionFailed()

void ipsdk::core::SocketsPoolCB::onConnectionFailed ( const Guid socketGuid,
const tcpip::EndPoint remoteEndPoint,
const boost::system::error_code &  ec 
)
protectedvirtual

method called when an outcoming connection request fails

Parameters
socketGuididentifier of the connection
remoteEndPointremote endpoint to which the peer tried to connect
eccause of the connection failure
Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false

Reimplemented from ipsdk::tcpip::CollPeersCB.

◆ onDeliveryFailed()

void ipsdk::core::SocketsPoolCB::onDeliveryFailed ( const Guid socketGuid,
ipUInt64  nDeliveryId 
)
protectedvirtual

method called each time a delivery request fails

Parameters
socketGuididentifier of the connection
nDeliveryIdidentifier of the delivery request
Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false

Reimplemented from ipsdk::tcpip::CollPeersCB.

◆ onDelivered()

void ipsdk::core::SocketsPoolCB::onDelivered ( const tcpip::SocketDesc socketDesc,
ipUInt64  nDeliveryId 
)
protectedvirtual

method called each time a delivery request succeeds

Parameters
socketDescdescription of the connection (id. + endpoints)
nDeliveryIdidentifier of the delivery request
Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false

Reimplemented from ipsdk::tcpip::CollPeersCB.

◆ simpleActionThread()

void ipsdk::core::SocketsPoolCB::simpleActionThread ( const tcpip::SocketDesc socketDesc,
const ActionPtr pAction 
)
protected

Thread execution function allowing to avoid to block socket data read processing loop when executing simple actions

◆ onRead()

void ipsdk::core::SocketsPoolCB::onRead ( const tcpip::SocketDesc socketDesc,
const SerializationObjectPtr  pObj 
)
protectedvirtual

method called each time a new object has been read through a connection

Parameters
socketDescdescription of the connection (id. + endpoints)
pObjread object
Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false

Reimplemented from ipsdk::tcpip::CollPeersCB.

◆ onConnectionLost()

void ipsdk::core::SocketsPoolCB::onConnectionLost ( const tcpip::SocketDesc socketDesc,
const boost::system::error_code &  ec 
)
protectedvirtual

method called each time an active connection is broken

Parameters
socketDescdescription of the connection (id. + endpoints)
eccause of the connection break
Note
if ec == boost::system::error_code(), the connection break is caused by a user close request
Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false

Reimplemented from ipsdk::tcpip::CollPeersCB.

◆ onConnectionClosed()

void ipsdk::core::SocketsPoolCB::onConnectionClosed ( const Guid socketGuid,
bool  bOnUserRequest 
)
protectedvirtual

method called when a connection is closed (follows a server connection break, or a user close request)

Parameters
socketGuididentifier of the peer
bOnUserRequestif true, connection was closed because of a user request
Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false

Reimplemented from ipsdk::tcpip::CollPeersCB.

◆ notifyConnection()

void ipsdk::core::SocketsPoolCB::notifyConnection ( const tcpip::Address remoteAddress,
const AddressColl slavesAddressColl 
)
protected

method allowing to notify for remote computer connection Remote computer provides its collection of slave ip addresses

Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false

Member Data Documentation

◆ _condition

boost::condition_variable ipsdk::core::SocketsPoolCB::_condition
mutableprotected

condition variable used for main thread end of initialization notification


The documentation for this class was generated from the following file: