Adaptyst
A comprehensive and architecture-agnostic performance analysis tool
Loading...
Searching...
No Matches
adaptyst::TCPAcceptor Class Reference

#include <socket.hpp>

Inheritance diagram for adaptyst::TCPAcceptor:
adaptyst::Acceptor

Classes

class  Factory
 

Public Member Functions

 ~TCPAcceptor ()
 
std::string get_connection_instructions ()
 
std::string get_type ()
 
- Public Member Functions inherited from adaptyst::Acceptor
std::unique_ptr< Connectionaccept (unsigned int buf_size, long timeout=NO_TIMEOUT)
 
virtual ~Acceptor ()
 

Protected Member Functions

std::unique_ptr< Connectionaccept_connection (unsigned int buf_size, long timeout)
 
void close ()
 
- Protected Member Functions inherited from adaptyst::Acceptor
 Acceptor (int max_accepted)
 

Detailed Description

A class describing a TCP acceptor.

Constructor & Destructor Documentation

◆ ~TCPAcceptor()

adaptyst::TCPAcceptor::~TCPAcceptor ( )
inline

Member Function Documentation

◆ accept_connection()

std::unique_ptr< Connection > adaptyst::TCPAcceptor::accept_connection ( unsigned int buf_size,
long timeout )
inlineprotectedvirtual

An internal method called by accept() accepting a new connection.

It should always return the new connection, regardless of the number of connections already accepted by the object.

Parameters
buf_sizeThe buffer size for communication, in bytes.
timeoutThe maximum number of seconds the acceptor will wait for to accept a connection. Afterwards, TimeoutException will be thrown. Use NO_TIMEOUT to wait indefinitely for a connection.

Implements adaptyst::Acceptor.

◆ close()

void adaptyst::TCPAcceptor::close ( )
inlineprotectedvirtual

Closes the acceptor.

Implements adaptyst::Acceptor.

◆ get_connection_instructions()

std::string adaptyst::TCPAcceptor::get_connection_instructions ( )
inlinevirtual

Returns "<TCP server address>_<TCP server port>".

Implements adaptyst::Acceptor.

◆ get_type()

std::string adaptyst::TCPAcceptor::get_type ( )
inlinevirtual

Gets the string describing the connection type of the acceptor (e.g. TCP).

Implements adaptyst::Acceptor.


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