aboutsummaryrefslogtreecommitdiff
path: root/src/old/connectionmonitor.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-04-03 03:49:53 +0000
committerMike Buland <eichlan@xagasoft.com>2007-04-03 03:49:53 +0000
commitf4c20290509d7ed3a8fd5304577e7a4cc0b9d974 (patch)
tree13cdf64f7cf134f397a7165b7a3fe0807e37026b /src/old/connectionmonitor.h
parent74d4c8cd27334fc7204d5a8773deb3d424565778 (diff)
downloadlibbu++-f4c20290509d7ed3a8fd5304577e7a4cc0b9d974.tar.gz
libbu++-f4c20290509d7ed3a8fd5304577e7a4cc0b9d974.tar.bz2
libbu++-f4c20290509d7ed3a8fd5304577e7a4cc0b9d974.tar.xz
libbu++-f4c20290509d7ed3a8fd5304577e7a4cc0b9d974.zip
Ok, no code is left in src, it's all in src/old. We'll gradually move code back
into src as it's fixed and re-org'd. This includes tests, which, I may write a unit test system into libbu++ just to make my life easier.
Diffstat (limited to 'src/old/connectionmonitor.h')
-rw-r--r--src/old/connectionmonitor.h47
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 */
13class ConnectionMonitor
14{
15public:
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