Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Socket by
Diff: TCPSocketConnection.h
- Revision:
- 8:9cf9c2d45264
- Parent:
- 7:ac5f77f4497a
- Child:
- 10:d24738f4ef99
--- a/TCPSocketConnection.h Fri Jul 27 14:22:45 2012 +0000 +++ b/TCPSocketConnection.h Fri Jul 27 15:50:23 2012 +0000 @@ -23,19 +23,19 @@ #include "Socket/Endpoint.h" /** -This is a C++ abstraction for TCP networking sockets. +TCP socket connection */ class TCPSocketConnection : public Socket, public Endpoint { friend class TCPSocketServer; public: - /** Instantiate a TCP Socket. + /** TCP socket connection */ TCPSocketConnection(); ~TCPSocketConnection(); - /** Connect the TCP Socket to the following host. + /** Connects this TCP socket to the server \param host The host to connect to. It can either be an IP Address or a hostname that will be resolved with DNS. \param port The host's port to connect to. \return 0 on success, -1 on failure. @@ -45,12 +45,12 @@ /** Send data to the remote host. \param data The buffer to send to the host. \param length The length of the buffer to send. - \param timeout The maximum amount of time in ms to wait while trying to send the buffer. + \param timeout_ms The maximum amount of time in ms to wait while trying to send the buffer. \return the number of written bytes on success (>=0) or -1 on failure */ int send(char* data, int length, int timeout_ms=0); - /** Send data to the remote host. + /** Send all the data to the remote host. \param data The buffer to send to the host. \param length The length of the buffer to send. \param timeout The maximum amount of time in ms to wait while trying to send the buffer. @@ -66,10 +66,10 @@ */ int receive(char* data, int length, int timeout_ms=0); - /** Receive data from the remote host. + /** Receive all the data from the remote host. \param data The buffer in which to store the data received from the host. \param length The maximum length of the buffer. - \param timeout The maximum amount of time in ms to wait while trying to receive data. + \param timeout_ms The maximum amount of time in ms to wait while trying to receive data. \return the number of received bytes on success (>=0) or -1 on failure */ int receive_all(char* data, int length, int timeout_ms=0);