Represents a single outgoing connection to a client.
#include <CConnection.hpp>
freedm::broker::CConnection::CConnection |
( |
std::string |
uuid, |
|
|
boost::asio::ip::udp::endpoint |
endpoint |
|
) |
| |
CConnection::CConnection
- Description:
- Create a connection to one particular peer. Initializes the selected message protocol used to deliver messages.
- Parameters
-
uuid | the UUID of the peer to connect to |
endpoint | The target to send the messages to for this connection. |
freedm::broker::CConnection::~CConnection |
( |
| ) |
|
void freedm::broker::CConnection::ChangePhase |
( |
bool |
newround | ) |
|
CConnection::ChangePhase
- Description:
- An event that gets called when the broker changes the current phase.
- Precondition:
- None
- Postcondition:
- The protocol's ChangePhase event is called.
- Parameters
-
newround | If true, the phase change is also the start of an entirely new round. |
int freedm::broker::CConnection::GetReliability |
( |
| ) |
const |
CConnection::GetReliability
- Description:
- Get the connection reliability for DCUSTOMNETWORK
- Precondition:
- None
- Postcondition:
- None
- Returns
- percentage of packets that are allowed through
bool freedm::broker::CConnection::GetStopped |
( |
| ) |
|
CConnection::GetStopped
- Description:
- Returns true if the underlying protocol has been stopped.
- Returns
- True if the underlying protocol is stopped.
std::string freedm::broker::CConnection::GetUUID |
( |
| ) |
const |
CConnection::GetUUID
- Description:
- Gets the UUID of the DGI on the other end of this connection.
- Precondition:
- None
- Postcondition:
- None
- Returns
- the peer's UUID
void freedm::broker::CConnection::OnReceive |
( |
| ) |
|
CConnection::OnReceive
- Description:
- Handles performing some action after processing a received window.
- Precondition:
- None
- Postcondition:
- Call's the protocol's OnReceive method.
bool freedm::broker::CConnection::Receive |
( |
const ProtocolMessage & |
msg | ) |
|
CConnection::Receive
- Description:
- Handler for receiving a non-ACK message from the peer
- Precondition:
- Initialized connection.
- Postcondition:
- Calls the protocol's Receive method.
- Parameters
-
msg | The message received from the peer. |
void freedm::broker::CConnection::ReceiveACK |
( |
const ProtocolMessage & |
msg | ) |
|
CConnection::ReceiveACK
- Description:
- Handler for recieving acknowledgments from the peer.
- Precondition:
- Initialized connection.
- Postcondition:
- Calls the protocol's ReceiveACK function
- Parameters
-
msg | The received acknowledge message. |
void freedm::broker::CConnection::Send |
( |
const ModuleMessage & |
msg | ) |
|
CConnection::Send
- Description:
- Passes a message to the protocol to deliver it to the intended recipient. If the intended recipient is this process, the delivery is done directly without the protocol.
- Precondition:
- None.
- Postcondition:
- The message is scheduled to be delivered.
- Parameters
-
msg | The message to write to the channel. |
void freedm::broker::CConnection::SetReliability |
( |
int |
r | ) |
|
CConnection::SetReliability
- Description:
- Set the connection reliability for DCUSTOMNETWORK.
- Parameters
-
r | between 0 and 100 – 0 meaning all packets are artifically dropped. 100 means no packets are artifically dropped. |
- Precondition:
- The DGI has been compiled with DCUSTOMNETWORK
- Postcondition:
- The reliability of the connection is changed
void freedm::broker::CConnection::Stop |
( |
| ) |
|
CConnection::Stop
- Description:
- Stops the protocol associated with this connection.
- Precondition:
- None.
- Postcondition:
- The message protocol's Stop method has been called.
boost::shared_ptr<IProtocol> freedm::broker::CConnection::m_protocol |
|
private |
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/freedm/checkouts/opnet-ecn/Broker/src/CConnection.hpp
- /home/docs/checkouts/readthedocs.org/user_builds/freedm/checkouts/opnet-ecn/Broker/src/CConnection.cpp