Go to the documentation of this file.
61 const int reuse_addr = 1;
63 SOCKLEN_T addrSize = 0;
65 rc = SOCKET(AF_INET, SOCK_STREAM, 0);
78 this->
sockaddr_.sin_addr.s_addr = INADDR_ANY;
79 this->
sockaddr_.sin_port = HTONS(port_num);
86 LOG_INFO(
"Server socket successfully initialized");
97 LOG_ERROR(
"Failed to set socket to listen");
123 int disableNodeDelay = 1;
147 LOG_WARN(
"Failed to set no socket delay, errno: %d, sending data can be delayed by up to 250ms", err);
154 LOG_ERROR(
"Failed to accept for client connection");
160 LOG_WARN(
"Tried to connect when socket already in connected state");
#define LOG_INFO(format,...)
#define LOG_WARN(format,...)
void setSrvrHandle(int srvr_handle_)
int getSockHandle() const
bool isConnected()
return connection status
#define LOG_ERROR(format,...)
bool init(int port_num)
initializes TCP server socket. The connect method must be called following initialization in order to...
sockaddr_in sockaddr_
address/port of remote socket
int getSrvrHandle() const
#define LOG_DEBUG(format,...)
void setSockHandle(int sock_handle_)
bool makeConnect()
connects to the remote host
static const int SOCKET_FAIL
socket fail return value
virtual void setConnected(bool connected)
simple_message
Author(s): Shaun Edwards
autogenerated on Wed Mar 2 2022 00:24:53