dodo  0.0.1
A C++ library to create containerized Linux services
dodo::network::TCPConnectionData Class Reference

Class to track a connection. More...

#include <tcplistener.hpp>

Collaboration diagram for dodo::network::TCPConnectionData:

Public Member Functions

 TCPConnectionData ()
 Construct. More...
 
virtual ~TCPConnectionData ()
 Destruct. More...
 
void clearBuffer ()
 Clears the read_buffer. More...
 
const common::BytesgetReadBuffer () const
 Get a reference to the read buffer. More...
 
common::SystemError readBuffer (BaseSocket *socket, ssize_t &received)
 Reads and appends data to read_buffer. More...
 

Protected Attributes

common::Bytes read_buffer
 Buffer for (incomplete) request data. More...
 

Detailed Description

Class to track a connection.

Definition at line 55 of file tcplistener.hpp.

Constructor & Destructor Documentation

◆ TCPConnectionData()

dodo::network::TCPConnectionData::TCPConnectionData ( )
inline

Construct.

Definition at line 61 of file tcplistener.hpp.

◆ ~TCPConnectionData()

virtual dodo::network::TCPConnectionData::~TCPConnectionData ( )
inlinevirtual

Destruct.

Definition at line 66 of file tcplistener.hpp.

Member Function Documentation

◆ clearBuffer()

void dodo::network::TCPConnectionData::clearBuffer ( )

Clears the read_buffer.

Definition at line 62 of file tcplistener.cpp.

◆ getReadBuffer()

const common::Bytes& dodo::network::TCPConnectionData::getReadBuffer ( ) const
inline

Get a reference to the read buffer.

Returns
a reference to the read buffer.

Definition at line 85 of file tcplistener.hpp.

References read_buffer.

◆ readBuffer()

common::SystemError dodo::network::TCPConnectionData::readBuffer ( BaseSocket socket,
ssize_t &  received 
)

Reads and appends data to read_buffer.

Parameters
socketThe socket to read from.
receivedThe number of bytes received.
Returns
The number of bytes read.

Definition at line 38 of file tcplistener.cpp.

References dodo::common::SystemError::asString(), dodo::common::SystemError::ecEAGAIN, dodo::common::SystemError::ecOK, dodo::common::Bytes::getArray(), dodo::network::BaseSocket::getFD(), dodo::common::Bytes::getSize(), dodo::common::Bytes::hexDump(), log_Debug, log_Error, log_Trace, dodo::network::BaseSocket::receive(), and dodo::common::Bytes::reserve().

Referenced by dodo::network::TCPServer::run().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ read_buffer

common::Bytes dodo::network::TCPConnectionData::read_buffer
protected

Buffer for (incomplete) request data.

Definition at line 89 of file tcplistener.hpp.

Referenced by getReadBuffer().


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