#include <main.h>
Collaboration diagram for Manager:
Public Member Functions | |
| Manager () | |
| ~Manager () | |
| PSafePtr< TcpConnection > | GetConnectionWithLock (const PString &token, PSafetyMode mode=PSafeReadWrite) |
| void | RemoveNode (const PString &token) |
| void | WaitForIncoming () |
| PString | ProcessMessagesName () |
| void | AppendRunning (PSafePtr< TcpConnection > conn, const PString &id) |
| void | AppendDead (PSafePtr< TcpConnection > conn) |
| void | QuitNow () |
| void | StopIncomingConnections () |
| void | GetListConnectedNodes (PStringArray &nodes) |
| BOOL | KeepRunning () |
| void | OnReleased (TcpConnection &connection) |
| void | WaitForEmpty () |
| void | GetStatus (PStringStream &status) |
| PString | GetNextBogusId () |
Protected Member Functions | |
| virtual void | DoQuitNow (PThread &, INT) |
Protected Attributes | |
| Manager::ConnectionDict | connectionsActive |
| PTCPSocket | listener |
| PAtomicInteger | bogusCount |
| PAtomicInteger | connectionCount |
| TcpConnectionList | availableTcpConnections |
| BOOL | keepRunning |
| BOOL | isQuitting |
| PMutex | quitNowMutex |
Classes | |
| class | ConnectionDict |
|
|
Constructor |
|
|
Destructor |
|
|
Append this connction to connectionsActive. We do not know what label to use on this connection, so we have to make up a label. We label it immediately as bogus, call manager.RemoveNode(), and let the garbage collector kill it |
|
||||||||||||
|
Append this connction to connectionsActive, cause it is a valid and running TcpConnection |
|
||||||||||||
|
This does the work of deleting all active connections. Using a thread to do the work saves a deadlock from an active connection trying to enact a close down. |
|
||||||||||||
|
Find a connection that uses the specified token. This searches the list of TcpConnections for the connection that contains the token as provided
|
|
|
Retrieve the list of connected nodes - which is the keys they are using to identify themselves |
|
|
Report the next string to use for creating a bogus id. This is used on those TcpConnection instances that do not start up correctly |
|
|
Report the status etc of this Manager class. List sizes, etc |
|
|
Report if the manager is to continue processing incoming connection requests |
|
|
Callback for removing a connection from the list of active connections |
|
|
Return a nnew unique name to be assigned to each neew process messages thread for a connection |
|
|
Cause a shutdown of the whole thing |
|
|
Remove the connection with the specified token |
|
|
StopAll incoming connect requests, by closing the socket on port 5000 |
|
|
Wait for the lists in this class to go empty |
|
|
Wait for incoming connections here. On receiving a connection, act on it. |
|
|
A class that manages the list of available TcpConnection threads |
|
|
The integer used to create unique id's for the dead TcpConnections |
|
|
The count of all threads that have beeen spawned to process messages |
|
|
The thread safe list of connections that we manage |
|
|
Flag to indicate we are in close down mode |
|
|
Flag that specifies that this Manager is to continue processing commands |
|
|
The socket that we listen for incoming connections on |
|
|
Mutex to protect access tothe close down flag |
1.4.4