VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vlTcpSocketMgr.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: vlTcpSocketMgr.h,v $ $Revision: 1.2.6.1 $ $State: Exp $
7 *********************************************************************/
8 #ifndef vlTcpSocketMgr_H_
9 #define vlTcpSocketMgr_H_
10 
14 
15 #include <vlutil/vlMachineTypes.h>
16 #include <vlutil/vlNetTypes.h>
17 #include <vlutil/vlUtil.h>
18 #include "vlTcpSocket.h"
19 
20 #ifdef DtUSE_UTILITIES_NAMESPACE
21 namespace DtUSE_UTILITIES_NAMESPACE
22 {
23 #endif
24 
25 
27 typedef void (*DtSocketAdditionCallback)(DtTcpSocket* sock, void* usr);
30 class DtTcpSocketMgr;
33 typedef DtSocket* (*DtSocketCreationCallback)(void* creator, DtTcpSocketMgr * mgr);
34 
35 
38 {
39 public:
40 
48  DtTcpSocketMgr(DtSocketCreationCallback cb, void *socketCreator, int port=DtDEFAULT_PORT);
49 
51  virtual ~DtTcpSocketMgr();
52 
55  virtual void processConnections();
56 
58  virtual int isOk() const;
59 
62  virtual int addrInUse() const;
63 
68  virtual DtIpv4Addr currentClientAddr() const;
69 
74  virtual int currentClientPort() const;
75 
80  virtual int currentSockFd() const;
81 
83  virtual const DtList* socketList();
84 
87  void removeAndDelete(DtTcpSocket* sock);
88 
92  void setNoDelay(bool onOff);
93 
96  virtual void addSocketAdditionCallback(
97  DtSocketAdditionCallback cb, void* usr);
98  virtual void removeSocketAdditionCallback(
99  DtSocketAdditionCallback cb, void* usr);
100 
103  virtual void addSocketRemovalCallback(
104  DtSocketRemovalCallback cb, void* usr);
105  virtual void removeSocketRemovalCallback(
106  DtSocketRemovalCallback cb, void* usr);
107 
111  virtual int sizeOffset();
112  virtual int sizeLength();
113  virtual void setSizeOffset(int offset);
114  virtual void setSizeLength(int length);
115 
118  virtual void setPacketBundling( unsigned int maxBundleSize );
119 
120 protected:
121 
123  virtual void emptyCallbackLists();
124 
127 
129  DtTcpSocketMgr& operator=(const DtTcpSocketMgr &);
130 
131 protected:
132 
137 
147  int myOk;
149  bool myNoDelay;
150  unsigned int myMaxBundleSize;
151 
156 
157 
161 };
162 
163 inline int DtTcpSocketMgr::isOk() const
164 {
165  return myOk;
166 }
167 
169 {
170  return mySizeLength;
171 }
172 
174 {
175  return mySizeOffset;
176 }
177 
178 #ifdef DtUSE_UTILITIES_NAMESPACE
179 }
180 #endif
181 
182 
183 #endif

Document ID: Generated on Thu Feb 22 04:26:36 EST 2018 from SVN revision 186468
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)