20 #pragma comment(lib, "WS2_32.LIB")
25 #include <sys/socket.h>
30 #include <sys/types.h>
31 #include <sys/ioctl.h>
33 #include <arpa/inet.h>
34 #include <netinet/in.h>
35 #include <sys/socket.h>
42 unsigned short listenPort,
const std::string& IPaddress,
52 WORD wVersionRequested;
55 wVersionRequested = MAKEWORD(2, 0);
57 if (0 != WSAStartup(wVersionRequested, &wsaData))
61 setupSocket(listenPort, IPaddress, maxConnectionsWaiting);
virtual ~CServerTCPSocket()
Dtor.
unsigned int m_serverSock
The handle for the listening server TCP socket.
void setupSocket(unsigned short listenPort, const std::string &IPaddress, int maxConnectionsWaiting)
Common code called from the platform-dependant constructor.
std::string getLastErrorStr()
Returns a description of the last Sockets error.
CServerTCPSocket(unsigned short listenPort, const std::string &IPaddress=std::string("127.0.0.1"), int maxConnectionsWaiting=50, mrpt::system::VerbosityLevel verbosityLevel=mrpt::system::LVL_INFO)
Constructor that creates the socket, performs binding, and start listening mode.
void setVerbosityLevel(const VerbosityLevel level)
alias of setMinLoggingLevel()
#define MRPT_TRY_START
The start of a standard MRPT "try...catch()" block that allows tracing throw the call stack after an ...
#define MRPT_TRY_END
The end of a standard MRPT "try...catch()" block that allows tracing throw the call stack after an ex...
#define THROW_EXCEPTION(msg)
GLsizei const GLchar ** string
Serial and networking devices and utilities.
VerbosityLevel
Enumeration of available verbosity levels.
mrpt::system::COutputLogger COutputLogger
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.