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);
A TCP socket that can be wait for client connections to enter.
bool isListening()
Returns true if the socket was successfully open and it's bound to the desired port.
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.
std::unique_ptr< CClientTCPSocket > accept(int timeout_ms=-1)
Waits for an incoming connection (indefinitely, or with a given timeout) The returned object represen...
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.
int m_serverSock
The handle for the listening server TCP socket.
virtual ~CServerTCPSocket()
Dtor.
GLsizei const GLchar ** string
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.