Go to the documentation of this file.
9 #ifndef CServerTCPSocket_H
10 #define CServerTCPSocket_H
21 class CClientTCPSocket;
31 #ifdef MRPT_OS_WINDOWS
34 unsigned int m_serverSock;
48 unsigned short listenPort,
49 const std::string &IPaddress,
50 int maxConnectionsWaiting );
63 unsigned short listenPort,
64 const std::string &IPaddress = std::string(
"127.0.0.1"),
65 int maxConnectionsWaiting = 50,
A TCP socket that can be wait for client connections to enter.
This base class provides a common printf-like method to send debug information to std::cout,...
std::string BASE_IMPEXP getLastSocketErrorStr()
Returns a description of the last Sockets error.
A TCP socket that can be connected to a TCP server, implementing MRPT's CStream interface for passing...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::string getLastErrorStr()
Returns a description of the last Sockets error.
~CServerTCPSocket()
Destructor.
CServerTCPSocket(unsigned short listenPort, const std::string &IPaddress=std::string("127.0.0.1"), int maxConnectionsWaiting=50, bool verbose=false)
Constructor that creates the socket, performs binding, and start listening mode.
int m_serverSock
The handle for the listening server TCP socket.
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.
bool isListening()
Returns true if the socket was successfully open and it's bound to the desired port.
Page generated by Doxygen 1.8.20 for MRPT 1.4.0 SVN: at Thu Aug 27 02:40:23 UTC 2020 | | |