NetworkSocketAPI
Dependents: HelloWizFi250Interface
Fork of NetworkSocketAPI by
Diff: SocketInterface.h
- Revision:
- 63:531f4c27f360
- Parent:
- 58:1caa187fa5af
- Child:
- 66:c84a4c76cb94
--- a/SocketInterface.h Wed Mar 02 16:52:25 2016 +0000 +++ b/SocketInterface.h Wed Mar 09 05:51:38 2016 +0000 @@ -20,11 +20,13 @@ #include "stdint.h" -/** Enum of socket protocols +/** + * @enum ns_protocol_t + * @brief enum of socket protocols */ enum ns_protocol_t { - NS_TCP, - NS_UDP, + NS_TCP, /*!< Socket is of TCP type */ + NS_UDP, /*!< Socket is of UDP type */ }; @@ -36,9 +38,9 @@ class SocketInterface { public: + virtual ~SocketInterface() {} - /** Open a connection to the underlying address * @param ip IP address to connect to * @param port Port to connect to @@ -60,7 +62,7 @@ /** Receive data * @note - * This call should return immediately with a value of 0 + * This call should return immediately with a value of 0 * if no data is available. * * @param data A buffer to store the data in @@ -69,12 +71,10 @@ */ virtual int32_t recv(void *data, uint32_t size) = 0; - /** Status of the socket * @return True if connected */ - virtual bool isConnected() - { + virtual bool isConnected() { // By default return true if socket was created successfully return true; }