#include <main.h>
Collaboration diagram for Manager:

Public Member Functions | |
| Manager (PINDEX _loopCount) | |
| ~Manager () | |
| void | StartGarbageCollection () |
| PSafePtr< TCPConnection > | GetConnectionWithLock (const PString &token, PSafetyMode mode=PSafeReadOnly) |
| void | RemoveNode (PString &token) |
| void | WaitForIncoming () |
| PString | ProcessMessagesName () |
| void | AppendRunning (PSafePtr< TCPConnection > conn, PString id) |
| void | AppendDead (PSafePtr< TCPConnection > conn) |
| void | RemoveGarbageCollector () |
| void | QuitNow () |
| void | StopIncomingConnections () |
| void | GetListConnectedNodes (PStringArray &nodes) |
| BOOL | IsTerminating () |
| void | OnReleased (TCPConnection &connection) |
Protected Member Functions | |
| void | CollectGarbage () |
| virtual void | GarbageMain (PThread &, INT) |
Protected Attributes | |
| Manager::ConnectionDict | connectionsActive |
| PThread * | garbageCollector |
| PSyncPoint | garbageExit |
| PTCPSocket | listener |
| PAtomicInteger | bogusCount |
| PAtomicInteger | connectionCount |
| PINDEX | loopCount |
| BOOL | terminateNow |
| TCPConnectionList | availableTCPConnections |
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 |
|
|
The method which does the garbage collection |
|
||||||||||||
|
This contains the 1 second delay loop, and calls to CollectGarbage |
|
||||||||||||
|
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 if we are terminating |
|
|
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 and terminate the garbage collector thread |
|
|
Remove the connection with the specified token |
|
|
start the garbage collection thread now |
|
|
StopAll incoming connect requests, by closing the socket on port 5000 |
|
|
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 |
|
|
The thread which runs every second to look for TCPConnections to delete |
|
|
The syncpoint that flags when we exit, and is used to time the 1 second gaps between cleaning |
|
|
The socket that we listen for incoming connections on |
|
|
The number of connection requests to fully process. The default of 0 means infinite |
|
|
A flag that is set wwhen we (the manager) are told to terminate and die |
1.4.4