Go to the documentation of this file.
20 #pragma comment(lib, "WS2_32.LIB")
26 #include <sys/socket.h>
30 #include <arpa/inet.h>
32 #include <netinet/in.h>
33 #include <sys/ioctl.h>
34 #include <sys/socket.h>
35 #include <sys/types.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);
void setupSocket(unsigned short listenPort, const std::string &IPaddress, int maxConnectionsWaiting)
Common code called from the platform-dependant constructor.
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()
Serial and networking devices and utilities.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
mrpt::system::COutputLogger COutputLogger
#define THROW_EXCEPTION(msg)
unsigned int m_serverSock
The handle for the listening server TCP socket.
#define MRPT_TRY_END
The end of a standard MRPT "try...catch()" block that allows tracing throw the call stack after an ex...
~CServerTCPSocket() override
Dtor.
VerbosityLevel
Enumeration of available verbosity levels.
#define MRPT_TRY_START
The start of a standard MRPT "try...catch()" block that allows tracing throw the call stack after an ...
std::string getLastErrorStr()
Returns a description of the last Sockets error.
Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sat Jun 27 14:00:59 UTC 2020 | |