Public Member Functions | Protected Member Functions | Private Attributes | List of all members
TCPSocket Class Reference

#include <tcp_socket.h>

Inheritance diagram for TCPSocket:
Inheritance graph
[legend]

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< SocketStatestate_
 

Detailed Description

Definition at line 35 of file tcp_socket.h.

Constructor & Destructor Documentation

TCPSocket::TCPSocket ( )

Definition at line 30 of file tcp_socket.cpp.

TCPSocket::~TCPSocket ( )
virtual

Definition at line 33 of file tcp_socket.cpp.

Member Function Documentation

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.

int TCPSocket::getSocketFD ( )
inline

Definition at line 59 of file tcp_socket.h.

SocketState TCPSocket::getState ( )
inline

Definition at line 54 of file tcp_socket.h.

virtual bool TCPSocket::open ( int  socket_fd,
struct sockaddr *  address,
size_t  address_len 
)
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.

void TCPSocket::setOptions ( int  socket_fd)
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.

bool TCPSocket::setup ( std::string &  host,
int  port 
)
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.

Member Data Documentation

std::atomic<int> TCPSocket::socket_fd_
private

Definition at line 38 of file tcp_socket.h.

std::atomic<SocketState> TCPSocket::state_
private

Definition at line 39 of file tcp_socket.h.


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


ur_modern_driver
Author(s): Thomas Timm Andersen, Simon Rasmussen
autogenerated on Fri Jun 26 2020 03:37:01