Manages open connections so that they may be cleanly stopped.
#include <CConnectionManager.hpp>
freedm::broker::CConnectionManager::CConnectionManager |
( |
| ) |
|
|
private |
void freedm::broker::CConnectionManager::ChangePhase |
( |
bool |
newround | ) |
|
CConnectionManager::ChangePhase
- Description:
- called when the broker changes phases in the realtime scheduler
- Precondition:
- None
- Postcondition:
- Each Connection's Change phase events is called.
- Parameters
-
newround | True if the phase change corresponds to a new round. |
ConnectionPtr freedm::broker::CConnectionManager::CreateConnection |
( |
std::string |
uuid, |
|
|
boost::asio::ip::udp::endpoint |
endpoint |
|
) |
| |
CConnectionManager::CreateConnection
- Description:
- Creates the CConnection object and binds it to an endpoint & uuid.
- Parameters
-
uuid | The uuid of the remote endpoint |
endpoint | The network destination for the messages sent to this peer. |
- Precondition:
- endpoint is a valid endpoint
- Postcondition:
- A new CConnection is created and bound to and endpoint. The resulting CConnection is inserted into the connection manager's map.
ConnectionPtr freedm::broker::CConnectionManager::GetConnectionByUUID |
( |
std::string |
uuid | ) |
|
CConnectionManager::GetConnectionByUUID
- Description:
- Constructs or retrieves a connection to a specific UUID.
- Parameters
-
uuid | The uuid of the peer you wish to connect to. |
- Precondition:
- None
- Postcondition:
- If a connection has been constructed it will be put in the connections table and be started. If the connection is not constructed there is no change to the connection table. Throws an exception of the connection couldn't be constructed.
- Returns
- A pointer to the connection
connectionmap::iterator freedm::broker::CConnectionManager::GetConnectionsBegin |
( |
| ) |
|
|
inline |
connectionmap::iterator freedm::broker::CConnectionManager::GetConnectionsEnd |
( |
| ) |
|
|
inline |
hostnamemap::iterator freedm::broker::CConnectionManager::GetHost |
( |
std::string |
uuid | ) |
|
|
inline |
hostnamemap::iterator freedm::broker::CConnectionManager::GetHostsBegin |
( |
| ) |
|
|
inline |
hostnamemap::iterator freedm::broker::CConnectionManager::GetHostsEnd |
( |
| ) |
|
|
inline |
bool freedm::broker::CConnectionManager::HasConnection |
( |
std::string |
uuid | ) |
|
CConnectionManager::HasConnection
- Description:
- Checks to see if the connection manager has a connection to the specified peer.
- Precondition:
- None
- Postcondition:
- If the connection is no longer valid, the connection manager will stop it.
- Parameters
-
uuid | The uuid of the peer. |
- Returns
- Returns true if the connection exists and has not stopped.
CConnectionManager::Instance
- Description:
- Access the singleton instance of the connection manager
- Precondition:
- None
- Postcondition:
- None
- Returns
- A reference to the Connection Manager.
void freedm::broker::CConnectionManager::LoadNetworkConfig |
( |
| ) |
|
CConnectionManager::LoadNetworkConfig
- Description:
- Accesses the network.xml file and parses it, setting the network reliability for all specified interfaces.
- Precondition:
- Only enabled with the -DCUSTOMNETWORK compile option
- Postcondition:
- All connections in the file are modified to behave as specified.
void freedm::broker::CConnectionManager::PutConnection |
( |
std::string |
uuid, |
|
|
ConnectionPtr |
c |
|
) |
| |
CConnectionManager::PutConnection
- Description:
- Registers a connection with the connection manager.
- Parameters
-
uuid | The uuid of the node the connection is to. |
c | The connection object that manages the channel to uuid |
- Precondition:
- The connection is initialized.
- Postcondition:
- The connection has been inserted into the connection map.
void freedm::broker::CConnectionManager::PutHost |
( |
std::string |
u, |
|
|
std::string |
host, |
|
|
std::string |
port |
|
) |
| |
CConnectionManager::PutHost
- Description:
- Registers a peer with the connection manager.
- Precondition:
- None
- Postcondition:
- The hostname is registered with the uuid to hostname map.
- Parameters
-
u | The peer's UUID |
host | The peer's hostname. |
port | The port the peer listens on. |
void freedm::broker::CConnectionManager::PutHost |
( |
std::string |
u, |
|
|
SRemoteHost |
host |
|
) |
| |
CConnectionManager::PutHost
- Description:
- Registers a peer with the connection manager
- Precondition:
- None
- Postcondition:
- The hostname is registered with the uuid to hostname map.
- Parameters
-
u | the uuid to enter into the map. |
host | The hostname and port to enter into the map. |
CConnectionManager::Stop
- Description:
- Stops a connection.
- Precondition:
- The connection is in the connections map.
- Postcondition:
- The connection is closed and removed from the connections map.
- Parameters
-
c | the connection pointer to stop. |
void freedm::broker::CConnectionManager::StopAll |
( |
| ) |
|
CConnectionManager::StopAll
- Description:
- Stops all the connections registered with the connection manager.
- Precondition:
- None
- Postcondition:
- The forward and reverse connection maps are empty, and all connections that were contained within them are stopped.
hostnamemap freedm::broker::CConnectionManager::m_hosts |
|
private |
boost::mutex freedm::broker::CConnectionManager::m_Mutex |
|
private |
The documentation for this class was generated from the following files: