Socket_TCP

class Socket_TCP

Bases: Socket_IP

Base functionality for a TCP connected socket This class is pretty useless by itself but it does hide some of the platform differences from machine to machine

Inheritance diagram

Inheritance diagram of Socket_TCP

bool ActiveOpen(Socket_Address const &theaddress, bool setdelay)

inline bool ActiveOpen(const Socket_Address &theaddress);

This function will try and set the socket up for active open to a specified address and port provided by the input parameter

bool ActiveOpenNonBlocking(Socket_Address const &theaddress)

This function will try and set the socket up for active open to a specified address and port provided by the input parameter (non-blocking version)

int DontLinger(void)

Turn off the linger flag. The socket will quickly release buffered items and free up OS resources. You may lose a stream if you use this flag and do not negotiate the close at the application layer.

bool ErrorIs_WouldBlocking(int err)
std::string RecvData(int max_len)

Read the data from the connection - if error 0 if socket closed for read or length is 0 + bytes read ( May be smaller than requested)

Read the data from the connection - if error 0 if socket closed for read or length is 0 + bytes read (May be smaller than requested)

int SendData(std::string const &str)

Ok Lets Send the Data - if error 0 if socket closed for write or lengh is 0 + bytes writen ( May be smaller than requested)

int SetLinger(int interval_seconds = 0)

will control the behavior of SO_LINGER for a TCP socket

int SetNoDelay(bool flag = true)

Disable Nagle algorithm. Don’t delay send to coalesce packets

int SetSendBufferSize(int insize)

Just like it sounds. Sets a buffered socket recv buffer size. This function does not refuse ranges outside hard-coded OS limits

bool ShutdownSend(void)
Socket_TCP(SOCKET)
Socket_TCP(void)
static TypeHandle get_class_type(void)