aboutsummaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2009-01-11 23:07:44 +0000
committerMike Buland <eichlan@xagasoft.com>2009-01-11 23:07:44 +0000
commit1291252a7b1317ad2dc13fbeb15f6e9d2d92192c (patch)
tree5eb88c7cef5417c043b03b34a77334c57286e526 /src/server.h
parent595afe519791894c77c77a949fba7732f4d94872 (diff)
downloadlibbu++-1291252a7b1317ad2dc13fbeb15f6e9d2d92192c.tar.gz
libbu++-1291252a7b1317ad2dc13fbeb15f6e9d2d92192c.tar.bz2
libbu++-1291252a7b1317ad2dc13fbeb15f6e9d2d92192c.tar.xz
libbu++-1291252a7b1317ad2dc13fbeb15f6e9d2d92192c.zip
A new feature has been added to Bu::Server. It's going to be trickier to
implement in Bu::ItoServer, but I'll get to it. Basically you can trigger a "tick" any time you want and it will propegate as an onTick event to all active clients. You can also have these generated automatically everytime the system passes through a polling cycle. In this case, you should never ever write data to the socket every tick. It will cause your program to go bursurk.
Diffstat (limited to '')
-rw-r--r--src/server.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server.h b/src/server.h
index 42cbb6a..55de081 100644
--- a/src/server.h
+++ b/src/server.h
@@ -58,6 +58,9 @@ namespace Bu
58 58
59 void addClient( int nSocket, int nPort ); 59 void addClient( int nSocket, int nPort );
60 60
61 void setAutoTick( bool bEnable=true );
62 void tick();
63
61 virtual void onNewConnection( Client *pClient, int nPort )=0; 64 virtual void onNewConnection( Client *pClient, int nPort )=0;
62 virtual void onClosedConnection( Client *pClient )=0; 65 virtual void onClosedConnection( Client *pClient )=0;
63 66
@@ -90,6 +93,7 @@ namespace Bu
90 SrvHash hServers; 93 SrvHash hServers;
91 typedef Hash<int,Client *> ClientHash; 94 typedef Hash<int,Client *> ClientHash;
92 ClientHash hClients; 95 ClientHash hClients;
96 bool bAutoTick;
93 }; 97 };
94} 98}
95 99