diff options
Diffstat (limited to 'src/old/connectionmonitor.h')
-rw-r--r-- | src/old/connectionmonitor.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/old/connectionmonitor.h b/src/old/connectionmonitor.h new file mode 100644 index 0000000..9910556 --- /dev/null +++ b/src/old/connectionmonitor.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /**@file | ||
2 | * Describes the ConnectionMonitor class. | ||
3 | */ | ||
4 | #ifndef CONNECTIONMONITOR_H | ||
5 | #define CONNECTIONMONITOR_H | ||
6 | |||
7 | #include "connection.h" | ||
8 | |||
9 | /** Connection Monitor defines the base class of the objects that will be | ||
10 | * notified whenever a connection is created or destroyed. | ||
11 | *@author Mike Buland | ||
12 | */ | ||
13 | class ConnectionMonitor | ||
14 | { | ||
15 | public: | ||
16 | /** | ||
17 | * This is only here for completeness. It does nothing. | ||
18 | */ | ||
19 | ConnectionMonitor(); | ||
20 | |||
21 | /** | ||
22 | * This is only here for completeness. It does nothing. | ||
23 | */ | ||
24 | virtual ~ConnectionMonitor(); | ||
25 | |||
26 | /** Receives the notification that new connection was received. | ||
27 | *@param pCon The connection that was created. | ||
28 | *@param nSocket The socket that the client connected to, used to determine | ||
29 | * which protocol to apply. | ||
30 | *@returns Should return a true value if everything is OK, a false to | ||
31 | * force a shutdown. | ||
32 | */ | ||
33 | virtual bool onNewConnection( Connection *pCon, int nPort ) = 0; | ||
34 | virtual bool onNewClientConnection( Connection *pCon, int nPort ) | ||
35 | { | ||
36 | return onNewConnection( pCon, nPort ); | ||
37 | }; | ||
38 | |||
39 | /** Receives the notification that a connection was closed. | ||
40 | *@param pCon The connection that was closed. | ||
41 | *@returns Should return a true value if everything is OK, a false to | ||
42 | * force a shutdown. | ||
43 | */ | ||
44 | virtual bool onClosedConnection( Connection *pCon ) = 0; | ||
45 | }; | ||
46 | |||
47 | #endif | ||