20 class CClientTCPSocket;
42 unsigned short listenPort,
44 int maxConnectionsWaiting = 50,
45 mrpt::utils::VerbosityLevel verbosityLevel = mrpt::utils::LVL_INFO);
60 std::unique_ptr<CClientTCPSocket>
accept(
int timeout_ms = -1);
64 #ifdef MRPT_OS_WINDOWS 76 unsigned short listenPort,
const std::string& IPaddress,
77 int maxConnectionsWaiting);
virtual ~CServerTCPSocket()
Dtor.
std::string getLastErrorStr()
Returns a description of the last Sockets error.
std::unique_ptr< CClientTCPSocket > accept(int timeout_ms=-1)
Waits for an incoming connection (indefinitely, or with a given timeout) The returned object represen...
A TCP socket that can be wait for client connections to enter.
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::utils::VerbosityLevel verbosityLevel=mrpt::utils::LVL_INFO)
Constructor that creates the socket, performs binding, and start listening mode.
GLsizei const GLchar ** string
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
int m_serverSock
The handle for the listening server TCP socket.
bool isListening()
Returns true if the socket was successfully open and it's bound to the desired port.