MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
peerToPeerSockMgr.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992, 1997 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: peerToPeerSockMgr.h,v $ $Revision: 1.10 $ $State: Exp $
7 *********************************************************************/
8 #ifndef DtPeerToPeerTcpSockMgr_H_
9 #define DtPeerToPeerTcpSockMgr_H_
10 
14 
15 #include "rtiMsConfig.h"
16 #include <vector>
17 #include <map>
18 #include <vlutil/vlTime.h>
19 #include <tcpMsgSocketMgr.h>
20 
21 typedef void (*DtSocketEstablishedCallback)(DtTcpMsgSocket* sock, void* usr);
22 
24 {
25 public:
26 
28  {
29  myCb = cb;
30  myUsr = usr;
31  }
32 
34  void *myUsr;
35 };
36 
46 {
47 public:
48 
50  DtPeerToPeerTcpSockMgr( int port,
51  DtBoost::shared_ptr<DtMsgHeaderReader> hdrRdr,
52  size_t recvBufferSize, int maxForwarderQueue);
53 
55  virtual ~DtPeerToPeerTcpSockMgr();
56 
58  virtual DtTcpMsgSocket* connectToPeer( const MAKRti::DtInetAddr& addr,
59  DtInetDevice* hostIf = 0 );
60 
65  virtual DtTcpMsgSocket* connectToPeer( const MAKRti::DtInetAddr& addr,
66  int port, DtInetDevice* hostIf = 0 );
67 
69  virtual void removeAndDeletePeerConnection(DtTcpMsgSocket* sock,
70  bool abort = true );
71 
73  unsigned int abortPendingConnections();
74 
76  unsigned int pendingConnectionsAborted();
77 
82  virtual void processConnections();
83 
84 
88  virtual void addSocketEstablishedCallback(
89  DtSocketEstablishedCallback cb, void* usr);
93  virtual void removeSocketEstablishedCallback(
94  DtSocketEstablishedCallback cb, void* usr);
95 
96 
97 private:
101 
102 protected:
103 
105 
107  int myPort;
108 
110  MAKRti::DtClock myClock;
111 
115 
118  std::map<DtTcpMsgSocket*, MAKRti::DtTime> myPendingConnections;
119 
122 
124  std::list<DtSocketCbInfo> myEstablishedCallbacks;
125 
126 };
127 
128 #endif

Document ID: Generated on Wed Mar 11 20:26:49 EDT 2015 from SVN revision 150939
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (www.mak.com)