aboutsummaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-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;