xale-db 1.0
minimal SQL engine, written in c++
Loading...
Searching...
No Matches
Xale::Net::IClientConnection Class Referenceabstract

Represents an established per-client TCP connection. More...

#include <IClientConnection.h>

Inheritance diagram for Xale::Net::IClientConnection:
Inheritance graph
Collaboration diagram for Xale::Net::IClientConnection:
Collaboration graph

Public Member Functions

virtual ~IClientConnection ()=default
virtual int read (std::vector< uint8_t > &buffer, size_t size)=0
 Read data from the client.
virtual int respond (const std::vector< uint8_t > *data, size_t size)=0
 Send data to the client.
virtual void close ()=0
 Close this client connection.

Detailed Description

Represents an established per-client TCP connection.

Returned by IListenerSocket::acceptClient(). Each instance is independent and safe to use from a dedicated thread.

Constructor & Destructor Documentation

◆ ~IClientConnection()

virtual Xale::Net::IClientConnection::~IClientConnection ( )
virtualdefault

Member Function Documentation

◆ close()

virtual void Xale::Net::IClientConnection::close ( )
pure virtual

Close this client connection.

Implemented in Xale::Net::LinuxSSLClientConnection.

◆ read()

virtual int Xale::Net::IClientConnection::read ( std::vector< uint8_t > & buffer,
size_t size )
pure virtual

Read data from the client.

Parameters
bufferBuffer filled with received bytes
sizeMaximum bytes to read
Returns
Bytes read, 0 on clean disconnect, <0 on error

Implemented in Xale::Net::LinuxSSLClientConnection.

◆ respond()

virtual int Xale::Net::IClientConnection::respond ( const std::vector< uint8_t > * data,
size_t size )
pure virtual

Send data to the client.

Parameters
dataData to send
sizeNumber of bytes to send
Returns
Bytes sent, <0 on error

Implemented in Xale::Net::LinuxSSLClientConnection.


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