aboutsummaryrefslogtreecommitdiff
path: root/src/itoserver.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-09-11 04:22:18 +0000
committerMike Buland <eichlan@xagasoft.com>2007-09-11 04:22:18 +0000
commit3839f50c3e22089f346d76a40782223cdcfadca7 (patch)
tree2b0d1621314f46313a9c87984cfdbdfa125e7a27 /src/itoserver.h
parentc82dc43edc9fd913e8ddb20bebe778781ec0d6f7 (diff)
downloadlibbu++-3839f50c3e22089f346d76a40782223cdcfadca7.tar.gz
libbu++-3839f50c3e22089f346d76a40782223cdcfadca7.tar.bz2
libbu++-3839f50c3e22089f346d76a40782223cdcfadca7.tar.xz
libbu++-3839f50c3e22089f346d76a40782223cdcfadca7.zip
Ok...forgot a couple of things. Bu::ItoServer now monitors all client
connections and actually cleans up behind them when they're all done. Seems important. It also will cleanup any lingering sockets that are laying around at destruction time, although right now unless you force-stop the server thread there is no way to interrupt it. That'll come in a bit.
Diffstat (limited to '')
-rw-r--r--src/itoserver.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/itoserver.h b/src/itoserver.h
index 19c34ca..60b15b4 100644
--- a/src/itoserver.h
+++ b/src/itoserver.h
@@ -7,6 +7,7 @@
7#include "bu/list.h" 7#include "bu/list.h"
8#include "bu/ito.h" 8#include "bu/ito.h"
9#include "bu/itomutex.h" 9#include "bu/itomutex.h"
10#include "bu/itoqueue.h"
10#include "bu/set.h" 11#include "bu/set.h"
11 12
12namespace Bu 13namespace Bu
@@ -36,6 +37,7 @@ namespace Bu
36 */ 37 */
37 class ItoServer : public Ito 38 class ItoServer : public Ito
38 { 39 {
40 friend class ItoClient;
39 public: 41 public:
40 ItoServer(); 42 ItoServer();
41 virtual ~ItoServer(); 43 virtual ~ItoServer();
@@ -78,11 +80,13 @@ namespace Bu
78 fd_set fdActive; 80 fd_set fdActive;
79 typedef Hash<int,ServerSocket *> ServerHash; 81 typedef Hash<int,ServerSocket *> ServerHash;
80 ServerHash hServers; 82 ServerHash hServers;
81 //typedef Bu::Set<ItoClient *> ClientSet; 83 typedef Hash<int,ItoClient *> ClientHash;
82 //ClientSet sClients; 84 typedef ItoQueue<ItoClient *> ClientQueue;
83 //typedef Hash<int,Client *> ClientHash; 85 ClientHash hClients;
84 //ClientHash hClients; 86 ClientQueue qClientCleanup;
85 ItoMutex im; 87 ItoMutex imClients;
88
89 void clientCleanup( int iSocket );
86 }; 90 };
87} 91}
88 92