|
Adaptyst
A comprehensive and architecture-agnostic performance analysis tool
|
#include <socket.hpp>
Public Member Functions | |
| virtual | ~Socket () |
| virtual std::string | get_address ()=0 |
| virtual unsigned short | get_port ()=0 |
| virtual unsigned int | get_buf_size ()=0 |
| virtual int | read (char *buf, unsigned int len, long timeout_seconds)=0 |
| virtual std::string | read (long timeout_seconds=NO_TIMEOUT)=0 |
| virtual void | write (std::string msg, bool new_line=true)=0 |
| virtual void | write (fs::path file)=0 |
| virtual void | write (unsigned int len, char *buf)=0 |
Public Member Functions inherited from adaptyst::Connection | |
| virtual | ~Connection () |
Protected Member Functions | |
| virtual void | close ()=0 |
An interface describing a network socket.
|
inlinevirtual |
|
protectedpure virtual |
|
pure virtual |
Gets the socket address string.
Implemented in adaptyst::TCPSocket.
|
pure virtual |
Gets the buffer size for communication, in bytes.
Implements adaptyst::Connection.
Implemented in adaptyst::TCPSocket.
|
pure virtual |
Gets the port of the socket.
Implemented in adaptyst::TCPSocket.
|
pure virtual |
Reads data from the connection.
| buf | A buffer where received data should be stored. |
| len | The size of the buffer. |
| timeout_seconds | A maximum number of seconds that can pass while waiting for the data. |
| TimeoutException | In case of timeout (see timeout_seconds). |
| ConnectionException | In case of any other errors. |
Implements adaptyst::Connection.
Implemented in adaptyst::TCPSocket.
|
pure virtual |
Reads a line from the connection.
| timeout_seconds | A maximum number of seconds that can pass while waiting for the data. Use NO_TIMEOUT for no timeout. |
| TimeoutException | In case of timeout (see timeout_seconds). |
| ConnectionException | In case of any other errors. |
Implements adaptyst::Connection.
Implemented in adaptyst::TCPSocket.
|
pure virtual |
Writes a file to the connection.
| file | The path to a file to be sent. |
| ConnectionException | In case of any errors. |
Implements adaptyst::Connection.
Implemented in adaptyst::TCPSocket.
|
pure virtual |
Writes a string to the connection.
| msg | A string to be sent. |
| new_line | Indicates whether a newline character should be appended to the string. |
| ConnectionException | In case of any errors. |
Implements adaptyst::Connection.
Implemented in adaptyst::TCPSocket.
|
pure virtual |
Writes data to the connection.
| len | The number of bytes to be sent. |
| buf | A buffer storing data to be written. Its size must be equal to or greater than the number of bytes to be sent. |
Implements adaptyst::Connection.
Implemented in adaptyst::TCPSocket.