aboutsummaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-06-12 01:28:27 +0000
committerMike Buland <eichlan@xagasoft.com>2007-06-12 01:28:27 +0000
commit4cb166570a8e2e97216bf6c7aeb99b971ff58ad7 (patch)
treeb8d22af96957666ac761b6ca1b57da1eee2e56a5 /src/server.h
parentb6f50f249ba3b18c597531a2d5dbc45f7bfa3eaa (diff)
downloadlibbu++-4cb166570a8e2e97216bf6c7aeb99b971ff58ad7.tar.gz
libbu++-4cb166570a8e2e97216bf6c7aeb99b971ff58ad7.tar.bz2
libbu++-4cb166570a8e2e97216bf6c7aeb99b971ff58ad7.tar.xz
libbu++-4cb166570a8e2e97216bf6c7aeb99b971ff58ad7.zip
Moved out the xml system again. I think that if I am going to do it again,
I'm going to do it over from scratch, that was just painful. Also, started in again on the server system, it's looking pretty good, already got connections working, next up is managing data flow through clients and protocols!
Diffstat (limited to 'src/server.h')
-rw-r--r--src/server.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/server.h b/src/server.h
index 9f4f459..942eb32 100644
--- a/src/server.h
+++ b/src/server.h
@@ -22,6 +22,10 @@ namespace Bu
22 * to the timeout set by setTimeout before returning if there is no data 22 * to the timeout set by setTimeout before returning if there is no data
23 * pending. scan should probably be called in some sort of tight 23 * pending. scan should probably be called in some sort of tight
24 * loop, possibly in it's own thread, or in the main control loop. 24 * loop, possibly in it's own thread, or in the main control loop.
25 *
26 * In order to use a Server you must subclass it and implement the pure
27 * virtual functions. These allow you to receive notification of events
28 * happening within the server itself, and actually makes it useful.
25 */ 29 */
26 class Server 30 class Server
27 { 31 {
@@ -35,7 +39,10 @@ namespace Bu
35 void scan(); 39 void scan();
36 void setTimeout( int nTimeoutSec, int nTimeoutUSec=0 ); 40 void setTimeout( int nTimeoutSec, int nTimeoutUSec=0 );
37 41
38 void addClient( int nSocket ); 42 void addClient( int nSocket, int nPort );
43
44 virtual void onNewConnection( Client *pClient, int nPort )=0;
45 virtual void onClosedConnection( Client *pClient )=0;
39 46
40 private: 47 private:
41 int nTimeoutSec; 48 int nTimeoutSec;