Webdar 1.0.0
Web user interface to libdar
Public Types | Public Member Functions | Protected Member Functions | List of all members
proto_connexion Class Referenceabstract

buffers data from a TCP connexion, this is a pure virtual class More...

#include <proto_connexion.hpp>

Inheritance diagram for proto_connexion:
Inheritance graph
[legend]

Public Types

enum  status { connected , not_connected }
 

Public Member Functions

 proto_connexion (const std::string &peerip, unsigned int peerport)
 constructor
 
 proto_connexion (const proto_connexion &ref)=delete
 forbidding copy constuctor and assignment operator
 
 proto_connexion (proto_connexion &&ref) noexcept=delete
 
proto_connexionoperator= (const proto_connexion &ref)=delete
 
proto_connexionoperator= (proto_connexion &&ref) noexcept=delete
 
virtual ~proto_connexion ()
 destructor
 
status get_status () const
 
const std::string & get_ip () const
 
unsigned int get_port () const
 
char read_one (bool blocking)
 extracts one byte form the buffer / exception thrown if not available
 
char read_test_first (bool blocking)
 
char read_test_second (bool blocking)
 
void write (const char *a, unsigned int size)
 write data More...
 
void flush_write ()
 flush pending writings if any
 

Protected Member Functions

virtual void write_impl (const char *a, unsigned int size)=0
 implementation of the low level (without buffering) writing operation More...
 
virtual unsigned int read_impl (char *a, unsigned int size, bool blocking)=0
 implementation of the low level (without buffering) reading operation More...
 
void set_status (status st)
 let inherited class modifying the object status
 

Detailed Description

buffers data from a TCP connexion, this is a pure virtual class

this class provide buffering mechanism to read block of data and broke then in pieces of bytes or single byte upon request

Member Function Documentation

◆ read_impl()

virtual unsigned int proto_connexion::read_impl ( char *  a,
unsigned int  size,
bool  blocking 
)
protectedpure virtual

implementation of the low level (without buffering) reading operation

Implemented in connexion, and ssl_connexion.

◆ read_test_first()

char proto_connexion::read_test_first ( bool  blocking)

gives the next char to be read, but do not remove it from the reading buffer / throw exception if not available

◆ read_test_second()

char proto_connexion::read_test_second ( bool  blocking)

gives the second next char to be read, but do not remove it from the reading buffer / throw exception if not available

◆ write()

void proto_connexion::write ( const char *  a,
unsigned int  size 
)

write data

param[in] a data to write param[in] size amount of byte to write

◆ write_impl()

virtual void proto_connexion::write_impl ( const char *  a,
unsigned int  size 
)
protectedpure virtual

implementation of the low level (without buffering) writing operation

Implemented in connexion, and ssl_connexion.


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