diff options
Diffstat (limited to '')
-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. */ |