![]() |
IPSDK
4_1_0_2
IPSDK : Image Processing Software Development Kit
|
class CliCollPeersCB More...
Public Member Functions | |
| virtual | ~CliCollPeersCB () |
| destructor | |
| void | join () |
| waits for all the threads of the threads pool to terminate and for the clients to be closed | |
Public Member Functions inherited from ipsdk::tcpip::CollPeersCB | |
| CollPeersCB () | |
| virtual | ~CollPeersCB () |
Static Public Member Functions | |
| static boost::shared_ptr< CliCollPeersCB > | create (const std::string &ipAddr, unsigned short nPortNumber, ipUInt16 nbThreads, ipUInt32 nbBuffers, ipUInt32 nbBytesPerBuffer, eSocketsMode socketsMode) |
| creates a new instance of boost::shared_ptr<CliCollPeersCB> More... | |
Protected Member Functions | |
| CliCollPeersCB (const std::string &ipAddr, unsigned short nPortNumber, ipUInt16 nbThreads, ipUInt32 nbBuffers, ipUInt32 nbBytesPerBuffer, eSocketsMode socketsMode) | |
| constructor More... | |
| void | setCollPeers (boost::shared_ptr< CollPeers > pCollPeers) |
| attaches a CollPeers object, and creates clients (depending on current sockets mode) that will connect to the server side on ip address listen port passed as argument of the constructor. CB methods of the class will be called when events associated to this CollPeers object will occur | |
| ipUInt16 | getNbExpectedSockets () |
| void | deliver (const Guid &rcvSocketGuid, const SerializationObjectPtr &pObj, const DlvCbFun &f=0) |
| delivers the object 'pObj' to the server, through the writeSocket if current More... | |
| void | askForBuffers () |
| wakes up all threads, so that they deliver an AskForBuffer object to the server side | |
| void | addBenchResult () |
| adds a new bench result, with the current test configuration name | |
| void | threadFun (unsigned int nThreadId, const ipsdk::Guid &socketGuid) |
| function run by each working thread More... | |
| virtual void | onConnected (const tcpip::SocketDesc &socketDesc) |
| overload of the callback method onConnected once all expected sockets are connected, delivers the ServerCfg object to the server side | |
| virtual void | onListenFailed (ipsdk::ipUInt16 acceptorId, const boost::system::error_code &ec) |
| overload of the callback method onListenFailed | |
| virtual void | onConnectionFailed (const Guid &peerId, const EndPoint &remoteEndPoint, const boost::system::error_code &ec) |
| overload of the callback method onConnectionFailed | |
| virtual void | onDeliveryFailed (const Guid &peerId, ipUInt64 nDeliveryId) |
| overload of the callback method onDeliveryFailed | |
| eSocketUsage | getServerSocketUsage (const Guid &socketGuid) |
| return the usage mode of the socket, seen from the server side | |
| virtual void | onRead (const tcpip::SocketDesc &socketDesc, const SerializationObjectPtr pObj) |
| overload of the callback method onRead | |
Protected Member Functions inherited from ipsdk::tcpip::CollPeersCB | |
| virtual void | onDelivered (const SocketDesc &socketDesc, ipUInt64 nDeliveryId) |
| method called each time a delivery request succeeds More... | |
| virtual void | onConnectionLost (const SocketDesc &socketDesc, const boost::system::error_code &ec) |
| method called each time an active connection is broken More... | |
| virtual void | onConnectionClosed (const Guid &peerId, bool bOnUserRequest) |
| method called when a connection is closed (follows a server connection break, or a user close request) More... | |
Protected Attributes | |
| ipUInt16 | _nbThreads |
| number of implemented working threads | |
| ServerCfg | _serverCfg |
| current tested configuration | |
| std::set< Guid > | _sockets |
| collection of identifiers of implemented sockets | |
| std::string | _ipAddr |
| IP address of the server. | |
| unsigned short | _nPortNumber |
| listening TCP/IP port number | |
| CollPeersPtr | _pCollPeers |
| CollPeers object used to communicate with server side. | |
| boost::thread_group | _threadsGroup |
| working threads pool | |
| Guid | _readSocketGuid |
| Guid | _writeSocketGuid |
| std::vector< int > | _askForBuffer |
| std::vector< int > | _writeBuffer |
| std::vector< int > | _stopThread |
| std::vector< BufferPtr > | _buffersToReturn |
| collection storing buffers that have to be sent back to server | |
| std::vector< MutexPtr > | _mutex |
| std::vector< CondPtr > | _cond |
| Chrono | _chrono |
class CliCollPeersCB
|
inlineprotected |
constructor
| ipAddr | IP address of the server to which to connect |
| nPortNumber | listening TCP/IP port |
| nbThreads | number of threads exchanging data with the server |
| nbBuffers | number of buffers available from server |
| nbBytesPerBuffer | size (in bytes) of buffers available from server |
| socketsMode | mode of sockets (one socket for all threads/one socket per thread/one read socket and one write socket for all threads) |
|
inlinestatic |
creates a new instance of boost::shared_ptr<CliCollPeersCB>
| ipAddr | IP address of the server to which to connect |
| nPortNumber | listening TCP/IP port |
| nbThreads | number of threads exchanging data with the server |
| nbBuffers | number of buffers available from server |
| nbBytesPerBuffer | size (in bytes) of buffers available from server |
| socketsMode | mode of sockets (one socket for all threads/one socket per thread/one read socket and one write socket for all threads) |
|
inlineprotected |
returns the number of expected sockets, depending on current number of threads and current sockets mode
|
inlineprotected |
delivers the object 'pObj' to the server, through the writeSocket if current
socketsMode equals "OneSocketForReadOneSocketForWrite", or through the socket passed as argument otherwise
|
inlineprotected |
function run by each working thread
| nThreadId | identifier of the working thread (from 0 to _nbThreads) |
| socketGuid | identifier of the associated socketGuid (not used in "oneSocketForReadOneSocketForWrite" socket mode) |
|
protected |
GUID of read socket (used in "oneSocketForReadOneSocketForWrite" SocketsMode only
|
protected |
GUID of write socket (used in "oneSocketForReadOneSocketForWrite" SocketsMode only
|
protected |
sync variable, used by each working thread to determine if an AskForBuffer object delivery is needed
|
protected |
sync variable, used by each working thread to determine if a Buffer object delivery is needed
|
protected |
sync variable, used by each working thread to determine if it has to terminate
|
protected |
mutex protecting access to sync variables _askForBuffer, _writeBuffer, _stopThread and _buffersToReturn
|
protected |
condition variables used with sync variables _askForBuffer, _writeBuffer, _stopThread and _buffersToReturn
|
protected |
chrono used to estimate time elapsed between first emission of AskForBuffer object and last working thread termination
1.8.14