|
Adaptyst
A comprehensive and architecture-agnostic performance analysis tool
|
#include <socket.hpp>
Classes | |
| class | Factory |
Public Member Functions | |
| std::unique_ptr< Connection > | accept (unsigned int buf_size, long timeout=NO_TIMEOUT) |
| virtual | ~Acceptor () |
| virtual std::string | get_connection_instructions ()=0 |
| virtual std::string | get_type ()=0 |
Protected Member Functions | |
| Acceptor (int max_accepted) | |
| virtual std::unique_ptr< Connection > | accept_connection (unsigned int buf_size, long timeout)=0 |
| virtual void | close ()=0 |
A class describing a connection acceptor.
|
inlineprotected |
Constructs an Acceptor object.
| max_accepted | A maximum number of connections that the acceptor can accept during its lifetime. Use UNLIMITED_ACCEPTED for no limit. |
|
inlinevirtual |
|
inline |
Accepts a new connection.
If the maximum number of accepted connections is reached, a runtime error is thrown immediately.
| buf_size | The buffer size for communication, in bytes. |
| timeout | The 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. |
| std::runtime_error | When the maximum number of accepted connections is reached. |
| TimeoutException | When the timeout is reached. |
|
protectedpure virtual |
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.
| buf_size | The buffer size for communication, in bytes. |
| timeout | The 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. |
Implemented in adaptyst::TCPAcceptor.
|
protectedpure virtual |
Closes the acceptor.
Implemented in adaptyst::TCPAcceptor.
|
pure virtual |
Gets the instructions how the other end of the connection should connect to this end so that accept() can return a Connection-derived object.
These are in form of a "<field1>_<field2>_..._<fieldX>" string, where the number of fields and their content are implementation-dependent.
Implemented in adaptyst::TCPAcceptor.
|
pure virtual |
Gets the string describing the connection type of the acceptor (e.g. TCP).
Implemented in adaptyst::TCPAcceptor.