18 class CClientTCPSocket;
40 unsigned short listenPort,
41 const std::string& IPaddress = std::string(
"127.0.0.1"),
42 int maxConnectionsWaiting = 50,
58 std::unique_ptr<CClientTCPSocket>
accept(
int timeout_ms = -1);
74 unsigned short listenPort,
const std::string& IPaddress,
75 int maxConnectionsWaiting);
VerbosityLevel
Enumeration of available verbosity levels.
std::string getLastErrorStr()
Returns a description of the last Sockets error.
unsigned int m_serverSock
The handle for the listening server TCP socket.
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.
Versatile class for consistent logging and management of output messages.
~CServerTCPSocket() override
Dtor.
bool isListening()
Returns true if the socket was successfully open and it's bound to the desired port.
Serial and networking devices and utilities.
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.