fort Socket

Fork of Socket by mbed official

Revision:
8:9cf9c2d45264
Parent:
6:cd2e5559786d
Child:
9:f972715add36
--- a/TCPSocketServer.h	Fri Jul 27 14:22:45 2012 +0000
+++ b/TCPSocketServer.h	Fri Jul 27 15:50:23 2012 +0000
@@ -21,29 +21,31 @@
 #include "Socket/Socket.h"
 #include "TCPSocketConnection.h"
 
+/** TCP Server.
+  */
 class TCPSocketServer : Socket {
   public:
-    /** Instantiate a TCP Socket.
+    /** Instantiate a TCP Server.
     */
     TCPSocketServer();
     
     ~TCPSocketServer();
     
     /** Bind a socket to a specific port.
-    For a listening socket, bind the socket to the following port. The socket will start listening for incoming connections on this port on the call to listen().
     \param port The port to listen for incoming connections on.
     \return 0 on success, -1 on failure.
     */
     int bind(int port);
-
+    
     /** Start listening for incoming connections.
-    \param max The maximum number of connections that can be accepted.
+    \param backlog number of pending connections that can be queued up at any one time.
     \return 0 on success, -1 on failure.
     */
-    int listen(int max);
-
+    int listen(int backlog);
+    
     /** Accept a new connection.
-    \param socket A socket instance that will handle the incoming connection.
+    \param connection A TCPSocketConnection instance that will handle the incoming connection.
+    \param timeout_ms The maximum amount of time in ms to wait for a new connection.
     \return 0 on success, -1 on failure.
     */
     int accept(TCPSocketConnection& connection, int timeout_ms=0);