|
R-Type 0.1
|
State the server keeps for one connected client. More...
#include <connection/Connection.hpp>
Public Member Functions | |
| Connection (std::uint32_t id, const asio::ip::udp::endpoint &endpoint) | |
| Creates a connection bound to a client address. | |
| std::uint32_t | getId () const |
| Returns the connection id. | |
| const asio::ip::udp::endpoint & | getEndpoint () const |
| Returns the client address. | |
| PacketHeader | makeHeader () |
| Builds the header of the next outgoing packet. | |
| PacketReceiveRes | onPacketReceived (const PacketHeader &header) |
| Records an incoming packet in the acknowledgement state. | |
State the server keeps for one connected client.
| Connection::Connection | ( | std::uint32_t | id, |
| const asio::ip::udp::endpoint & | endpoint ) |
Creates a connection bound to a client address.
| id | Connection id given to the client. |
| endpoint | Client address and port. |
| std::uint32_t Connection::getId | ( | ) | const |
Returns the connection id.
| const asio::ip::udp::endpoint & Connection::getEndpoint | ( | ) | const |
Returns the client address.
| PacketHeader Connection::makeHeader | ( | ) |
Builds the header of the next outgoing packet.
| PacketReceiveRes Connection::onPacketReceived | ( | const PacketHeader & | header | ) |
Records an incoming packet in the acknowledgement state.
| header | Header of the received packet. |