IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
CollPeersCB.h
1 // CollPeersCB.h:
3 // --------------
4 //
16 
17 #ifndef __IPSDKCOMM_COLLPEERSCB_H__
18 #define __IPSDKCOMM_COLLPEERSCB_H__
19 
21 #include <IPSDKComm/TcpIp/EndPoint.h>
22 #include <IPSDKUtil/Tools/Guid.h>
23 
24 // --- Includes boost
25 #include <boost/system/error_code.hpp>
26 
27 namespace ipsdk {
28 namespace tcpip {
29 
30 class CollPeers;
31 class SocketDesc;
32 
35 
37 {
38 public:
41  CollPeersCB();
42  virtual ~CollPeersCB();
44 
45 // methods
46 public:
47 
48 // attributes
49 protected:
53  virtual void onConnected(const SocketDesc& socketDesc) {}
54 
59  virtual void onListenFailed(ipsdk::ipUInt16 acceptorId,
60  const boost::system::error_code& ec) {}
61 
66  virtual void onConnectionFailed(const Guid& peerId,
67  const EndPoint& remoteEndPoint,
68  const boost::system::error_code& ec) {}
69 
73  virtual void onDeliveryFailed(const Guid& peerId, ipUInt64 nDeliveryId) {}
74 
78  virtual void onDelivered(const SocketDesc& socketDesc,
79  ipUInt64 nDeliveryId) {}
80 
85  virtual void onRead(const SocketDesc& socketDesc,
86  const SerializationObjectPtr pObj) {}
87 
93  virtual void onConnectionLost(const SocketDesc& socketDesc,
94  const boost::system::error_code& ec) {}
95 
100  virtual void onConnectionClosed(const Guid& peerId, bool bOnUserRequest) {}
101 
102  friend class CollPeers;
103 };
104 
107 
108 } // end of namespace tcpip
109 } // end of namespace ipsdk
110 
111 #endif // __IPSDKCOMM_COLLPEERSCB_H__
virtual void onListenFailed(ipsdk::ipUInt16 acceptorId, const boost::system::error_code &ec)
Definition: CollPeersCB.h:59
virtual void onRead(const SocketDesc &socketDesc, const SerializationObjectPtr pObj)
method called each time a new object has been read through a connection
Definition: CollPeersCB.h:85
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
virtual void onConnectionLost(const SocketDesc &socketDesc, const boost::system::error_code &ec)
method called each time an active connection is broken
Definition: CollPeersCB.h:93
serializable overlay of boost::asio::endpoint
Definition: EndPoint.h:34
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
Definition of import/export macro for library.
virtual void onDelivered(const SocketDesc &socketDesc, ipUInt64 nDeliveryId)
method called each time a delivery request succeeds
Definition: CollPeersCB.h:78
virtual void onDeliveryFailed(const Guid &peerId, ipUInt64 nDeliveryId)
method called each time a delivery request fails
Definition: CollPeersCB.h:73
Class encapsulating an auto initialized uuid.
Definition: Guid.h:27
virtual void onConnected(const SocketDesc &socketDesc)
method called each time a new incoming connection is accepted, or a an outcoming connection is establ...
Definition: CollPeersCB.h:53
Definition: SocketDesc.h:35
boost::shared_ptr< BaseSerializationObject > SerializationObjectPtr
shared pointer to a base serialization object
Definition: SerializationTypes.h:23
virtual void onConnectionFailed(const Guid &peerId, const EndPoint &remoteEndPoint, const boost::system::error_code &ec)
Definition: CollPeersCB.h:66
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...
Definition: CollPeersCB.h:100
#define IPSDKCOMM_API
Import/Export macro for library IPSDKComm.
Definition: IPSDKCommExports.h:25
Callback class, intended to be used by CollPeers class, and whose methods will be called each time an...
Definition: CollPeersCB.h:36
uint16_t ipUInt16
Base types definition.
Definition: BaseTypes.h:51