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.
Dependencies: DnsQuery
Dependents: WizFi310_TCP_Echo_Server_Example
Fork of NetworkSocketAPI by
Diff: SocketInterface.h
- Branch:
- api-changes
- Revision:
- 48:b3bbe28a7963
- Parent:
- 43:09ea32f2eb54
- Child:
- 53:26b5f1c69822
--- a/SocketInterface.h Thu Feb 25 21:58:46 2016 +0000
+++ b/SocketInterface.h Thu Feb 25 03:13:26 2016 -0600
@@ -46,11 +46,6 @@
*/
virtual void setPort(uint16_t port) { (void)port; }
- /** Set a timeout on network operations
- * @param timeout Maximum time in milliseconds for socket operations
- */
- virtual void setTimeout(uint32_t timeout) { (void)timeout; }
-
/** Status of the socket
* @return True if connected
*/
@@ -74,17 +69,21 @@
/** Send data
* @param data Buffer of data to send
- * @param len Size of data to send
+ * @param size Size of data to send
* @return 0 on success
*/
- virtual int32_t send(const void *data, uint32_t len) = 0;
+ virtual int32_t send(const void *data, uint32_t size) = 0;
- /** In client or server mode receive data
- * @param data a buffer to store the data in
- * @param amount The amount of data to receive
- * @return Number of bytes sent or a negative value on failure
+ /** Receive data
+ * @note
+ * This call should return immediately with a value of 0
+ * if no data is available.
+ *
+ * @param data A buffer to store the data in
+ * @param size Size of buffer
+ * @return Number of bytes received or a negative value on failure
*/
- virtual int32_t recv(void *data, uint32_t len) = 0;
+ virtual int32_t recv(void *data, uint32_t size) = 0;
};
#endif
