EPS Conduits  v0.0.2-2413
networking over networking
EPS::TCPConnection Class Referencefinal

TCP connection. More...

#include "TCPConnection.hpp"

Inheritance diagram for EPS::TCPConnection:
Collaboration diagram for EPS::TCPConnection:

Public Member Functions

virtual ~TCPConnection (void)
 Destructor. More...
 
virtual void async_connect (void)
 Perform an asynchronous connect to the endpoint specified when the object was constructed. More...
 
virtual void accepted (void)
 Call when a connection is accepted to refresh some of the internal values. More...
 
virtual void set_socket_options (void)
 Set various socket options. More...
 
 TCPConnection (void)
 Constructor. More...
 
 TCPConnection (const EPS::TCPEP &eth_endpoint, const EPS::UUID &uuid=boost::uuids::nil_uuid())
 

Public Attributes

bool is_mesh
 is this connection a client<->server connection, or part of the mesh network? More...
 
boost::asio::ip::tcp::socket socket
 TCP socket for this TCP connection. More...
 
TCPEP endpoint
 TCP endpoint. More...
 
EPS::NBDeque pending_write_deque
 Calls to async_write() cannot overlap, so we must store NetBuffers until they can be sent. More...
 
size_t id
 unique connection id, helpful when logging connection-specific messages More...
 
std::string name
 convenient name to use for logging More...
 
UUID uuid
 corresponding UUID for this peer connection More...
 
Hullhull
 for convenience, keep a reference to the hull that created this connection More...
 
EC ec
 boost error code More...
 

Detailed Description

TCP connection.

Constructor & Destructor Documentation

◆ TCPConnection() [1/2]

EPS::TCPConnection::TCPConnection ( void  )

Constructor.

Create a brand new TCP connection object but don't automatically connect the socket anywhere. For example, this is used when the listener needs an object to accept a new connection. Expect EPS::TCPConnection::accepted() to be called once an actual connection has been accepted.

◆ TCPConnection() [2/2]

EPS::TCPConnection::TCPConnection ( const EPS::TCPEP eth_endpoint,
const EPS::UUID uuid = boost::uuids::nil_uuid() 
)

Create a brand new TCP connection to the endpoint provided.

◆ ~TCPConnection()

EPS::TCPConnection::~TCPConnection ( void  )
virtual

Destructor.

Member Function Documentation

◆ accepted()

void EPS::TCPConnection::accepted ( void  )
virtual

Call when a connection is accepted to refresh some of the internal values.

Called after a new TCP connection has been accepted by a listener/acceptor.

Here is the call graph for this function:

◆ async_connect()

void EPS::TCPConnection::async_connect ( void  )
virtual

Perform an asynchronous connect to the endpoint specified when the object was constructed.

Here is the call graph for this function:

◆ set_socket_options()

void EPS::TCPConnection::set_socket_options ( void  )
virtual

Set various socket options.

Implements EPS::Connection.

Here is the caller graph for this function:

Member Data Documentation

◆ ec

EC EPS::Connection::ec
inherited

boost error code

◆ endpoint

TCPEP EPS::TCPConnection::endpoint

TCP endpoint.

◆ hull

Hull& EPS::Connection::hull
inherited

for convenience, keep a reference to the hull that created this connection

◆ id

size_t EPS::Connection::id
inherited

unique connection id, helpful when logging connection-specific messages

◆ is_mesh

bool EPS::TCPConnection::is_mesh

is this connection a client<->server connection, or part of the mesh network?

◆ name

std::string EPS::Connection::name
inherited

convenient name to use for logging

◆ pending_write_deque

EPS::NBDeque EPS::TCPConnection::pending_write_deque

Calls to async_write() cannot overlap, so we must store NetBuffers until they can be sent.

◆ socket

boost::asio::ip::tcp::socket EPS::TCPConnection::socket

TCP socket for this TCP connection.

◆ uuid

UUID EPS::Connection::uuid
inherited

corresponding UUID for this peer connection

See also
EPS::Tracker which uses the uuid as the key

The documentation for this class was generated from the following files: