|
Adaptyst
A comprehensive and architecture-agnostic performance analysis tool
|
#include <socket.hpp>
Public Member Functions | |
| TCPSocket (net::StreamSocket &sock, unsigned int buf_size) | |
| ~TCPSocket () | |
| std::string | get_address () |
| unsigned short | get_port () |
| unsigned int | get_buf_size () |
| int | read (char *buf, unsigned int len, long timeout_seconds) |
| std::string | read (long timeout_seconds=NO_TIMEOUT) |
| void | write (std::string msg, bool new_line) |
| void | write (fs::path file) |
| void | write (unsigned int len, char *buf) |
Public Member Functions inherited from adaptyst::Socket | |
| virtual | ~Socket () |
Public Member Functions inherited from adaptyst::Connection | |
| virtual | ~Connection () |
Protected Member Functions | |
| void | close () |
A class describing a TCP socket.
|
inline |
Constructs a TCPSocket object.
| sock | The Poco::Net::StreamSocket object corresponding to the already-established TCP socket. |
| buf_size | The buffer size for communication, in bytes. |
|
inline |
|
protectedvirtual |
Closes the connection.
Implements adaptyst::Socket.
|
inlinevirtual |
Gets the socket address string.
Implements adaptyst::Socket.
|
inlinevirtual |
Gets the buffer size for communication, in bytes.
Implements adaptyst::Socket.
|
inlinevirtual |
Gets the port of the socket.
Implements adaptyst::Socket.
|
inlinevirtual |
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::Socket.
|
inlinevirtual |
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::Socket.
|
inlinevirtual |
Writes a file to the connection.
| file | The path to a file to be sent. |
| ConnectionException | In case of any errors. |
Implements adaptyst::Socket.
|
inlinevirtual |
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::Socket.
|
inlinevirtual |
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::Socket.