1#ifndef TCP_CONNECTION_HXX
2#define TCP_CONNECTION_HXX
15class ConnectionManager;
32 asio::ip::tcp::socket&
socket();
45 virtual void onReceiveSuccess(
const asio::ip::address& address,
unsigned short port,
const std::shared_ptr<DataBuffer>& data);
Manages open connections so that they may be cleanly stopped when the server needs to shut down,...
The common handler for all incoming requests.
Represents a single connection from a client.
virtual void stop()
Stop all asynchronous operations associated with the connection.
RequestHandler & mRequestHandler
The handler used to process the incoming request.
virtual void onSendFailure(const asio::error_code &e)
TcpConnection & operator=(TcpConnection &&)=delete
asio::ip::tcp::socket & socket()
Get the socket associated with the connection.
TcpConnection & operator=(const TcpConnection &)=delete
virtual void close()
Override close fn in AsyncTcpSocketBase so that we can remove ourselves from connection manager.
asio::ip::address mLocalAddress
TcpConnection(TcpConnection &&)=delete
TcpConnection(const TcpConnection &)=delete
virtual void onReceiveSuccess(const asio::ip::address &address, unsigned short port, const std::shared_ptr< DataBuffer > &data)
Handle completion of a receive operation.
unsigned short mLocalPort
virtual void start()
Start the first asynchronous operation for the connection.
virtual void onReceiveFailure(const asio::error_code &e)
virtual void onSendSuccess()
Handle completion of a send operation.
TurnAllocationManager mTurnAllocationManager
Manages turn allocations.
ConnectionManager & mConnectionManager
The connection manager for this connection.