diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-05-03 08:42:32 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-05-03 08:42:32 +0000 |
commit | 68db829db66dbf8faad5bd8df35760b5af3a1491 (patch) | |
tree | d1b79a641a14966dbd1bb2bea6625454db7f64a4 /src/connectionmanager.h | |
parent | 96b00553a0ffe6bb34af6ad15e1cfc2bed67bd75 (diff) | |
download | libbu++-68db829db66dbf8faad5bd8df35760b5af3a1491.tar.gz libbu++-68db829db66dbf8faad5bd8df35760b5af3a1491.tar.bz2 libbu++-68db829db66dbf8faad5bd8df35760b5af3a1491.tar.xz libbu++-68db829db66dbf8faad5bd8df35760b5af3a1491.zip |
Sweet, all changes from the (once again 1 rev) branch have been merged back in.
Now to finalize the changes in my other programs.
Diffstat (limited to 'src/connectionmanager.h')
-rw-r--r-- | src/connectionmanager.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/connectionmanager.h b/src/connectionmanager.h index 669fcd5..da49a39 100644 --- a/src/connectionmanager.h +++ b/src/connectionmanager.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include "connectionmonitor.h" | 12 | #include "connectionmonitor.h" |
13 | #include <sys/types.h> | 13 | #include <sys/types.h> |
14 | #include <list> | 14 | #include <list> |
15 | #include <map> | ||
15 | 16 | ||
16 | /** Manges incoming network connections as a server. Creates and works with | 17 | /** Manges incoming network connections as a server. Creates and works with |
17 | * Connection objects. All operations are performed on TCP/IP v4 right now, | 18 | * Connection objects. All operations are performed on TCP/IP v4 right now, |
@@ -26,7 +27,7 @@ public: | |||
26 | * actually start a server, bind to a port, or create a connection pool. | 27 | * actually start a server, bind to a port, or create a connection pool. |
27 | * That's all handled by startServer(). | 28 | * That's all handled by startServer(). |
28 | */ | 29 | */ |
29 | ConnectionManager(); | 30 | ConnectionManager( int nInitPool=40 ); |
30 | 31 | ||
31 | /** | 32 | /** |
32 | * Cleans up everything, and even clears out all still-connected Connection | 33 | * Cleans up everything, and even clears out all still-connected Connection |
@@ -42,7 +43,7 @@ public: | |||
42 | *@returns True if the socket was bound to the port and serving was | 43 | *@returns True if the socket was bound to the port and serving was |
43 | * started. False if there was a problem connecting to the port. | 44 | * started. False if there was a problem connecting to the port. |
44 | */ | 45 | */ |
45 | bool startServer( int nPort, int nInitPool ); | 46 | bool startServer( int nPort ); |
46 | 47 | ||
47 | /** | 48 | /** |
48 | * This is identicle to the simpler startServer function except that it | 49 | * This is identicle to the simpler startServer function except that it |
@@ -59,7 +60,7 @@ public: | |||
59 | *@returns True if the socket was bound to the port and serving was | 60 | *@returns True if the socket was bound to the port and serving was |
60 | * started. False if there was a problem connecting to the port. | 61 | * started. False if there was a problem connecting to the port. |
61 | */ | 62 | */ |
62 | bool startServer( int nPort, int nInitPool, int nNumTries, int nTimeout ); | 63 | bool startServer( int nPort, int nNumTries, int nTimeout ); |
63 | 64 | ||
64 | /** | 65 | /** |
65 | * Scans all open connections, halting the calling processes until data | 66 | * Scans all open connections, halting the calling processes until data |
@@ -98,9 +99,11 @@ private: | |||
98 | * accept the connection, set the initial modes, and add it to the master | 99 | * accept the connection, set the initial modes, and add it to the master |
99 | * list of active connections, as well as fire off any messages that need | 100 | * list of active connections, as well as fire off any messages that need |
100 | * to be handled by anything else. | 101 | * to be handled by anything else. |
102 | *@param nSocket The handle of the listening socket that had an incoming | ||
103 | * connection. | ||
101 | *@returns True if everything worked, False otherwise. | 104 | *@returns True if everything worked, False otherwise. |
102 | */ | 105 | */ |
103 | bool addConnection(); | 106 | bool addConnection( int nSocket ); |
104 | 107 | ||
105 | /** | 108 | /** |
106 | * Seraches the internal lists of connections for one with a specific | 109 | * Seraches the internal lists of connections for one with a specific |
@@ -122,7 +125,8 @@ private: | |||
122 | */ | 125 | */ |
123 | Connection *getInactiveConnection(); | 126 | Connection *getInactiveConnection(); |
124 | 127 | ||
125 | int nMasterSocket; /**< The listening or server socket. */ | 128 | std::map<int,int> sMasterSocket; |
129 | //int nMasterSocket; /**< The listening or server socket. */ | ||
126 | fd_set fdActive; /**< The active socket set. */ | 130 | fd_set fdActive; /**< The active socket set. */ |
127 | fd_set fdRead; /**< The sockets ready for a read. */ | 131 | fd_set fdRead; /**< The sockets ready for a read. */ |
128 | fd_set fdWrite; /**< The sockets ready for a write. */ | 132 | fd_set fdWrite; /**< The sockets ready for a write. */ |