#include <tcp_socket.h>
Public Member Functions | |
void | close () |
std::string | getIP () |
int | getSocketFD () |
SocketState | getState () |
bool | read (char *character) |
bool | read (uint8_t *buf, size_t buf_len, size_t &read) |
bool | setSocketFD (int socket_fd) |
TCPSocket () | |
bool | write (const uint8_t *buf, size_t buf_len, size_t &written) |
virtual | ~TCPSocket () |
Protected Member Functions | |
virtual bool | open (int socket_fd, struct sockaddr *address, size_t address_len) |
virtual void | setOptions (int socket_fd) |
bool | setup (std::string &host, int port) |
Private Attributes | |
std::atomic< int > | socket_fd_ |
std::atomic< SocketState > | state_ |
Definition at line 35 of file tcp_socket.h.
TCPSocket::TCPSocket | ( | ) |
Definition at line 30 of file tcp_socket.cpp.
|
virtual |
Definition at line 33 of file tcp_socket.cpp.
void TCPSocket::close | ( | ) |
Definition at line 108 of file tcp_socket.cpp.
std::string TCPSocket::getIP | ( | ) |
Definition at line 117 of file tcp_socket.cpp.
|
inline |
Definition at line 59 of file tcp_socket.h.
|
inline |
Definition at line 54 of file tcp_socket.h.
|
inlineprotectedvirtual |
Reimplemented in URServer, and URStream.
Definition at line 42 of file tcp_socket.h.
bool TCPSocket::read | ( | char * | character | ) |
Definition at line 134 of file tcp_socket.cpp.
bool TCPSocket::read | ( | uint8_t * | buf, |
size_t | buf_len, | ||
size_t & | read | ||
) |
Definition at line 143 of file tcp_socket.cpp.
|
protectedvirtual |
Definition at line 38 of file tcp_socket.cpp.
bool TCPSocket::setSocketFD | ( | int | socket_fd | ) |
Definition at line 99 of file tcp_socket.cpp.
|
protected |
Definition at line 45 of file tcp_socket.cpp.
bool TCPSocket::write | ( | const uint8_t * | buf, |
size_t | buf_len, | ||
size_t & | written | ||
) |
Definition at line 164 of file tcp_socket.cpp.
|
private |
Definition at line 38 of file tcp_socket.h.
|
private |
Definition at line 39 of file tcp_socket.h.