pefect / NetworkSocketAPI

Dependencies:   DnsQuery

Dependents:   WizFi310_TCP_Echo_Server_Example

Fork of NetworkSocketAPI by NetworkSocketAPI

Branch:
api-changes
Revision:
41:3ec1c97e9bbf
Parent:
38:157fb2ab965f
Child:
42:49893d13c432
--- a/SocketInterface.h	Mon Feb 22 23:52:09 2016 -0600
+++ b/SocketInterface.h	Tue Feb 23 04:01:38 2016 -0600
@@ -37,7 +37,7 @@
 {
 public:
     /** Set the IP address of the socket
-     *  @param ip IP address to connect to, copied internally
+     *  @param ip IP address to connect to
      */
     virtual void setIPAddress(const char *ip);
 
@@ -46,6 +46,11 @@
      */
     virtual void setPort(uint16_t port);
 
+    /** Set a timeout on network operations
+     *  @param timeout Maximum time in milliseconds for socket operations
+     */
+    virtual void setTimeout(uint32_t timeout);
+
     /** Status of the socket
      *  @return True if connected
      */
@@ -66,18 +71,16 @@
     /** Send data
      *  @param data Buffer of data to send
      *  @param len Size of data to send
-     *  @param timeout_ms Maximum amount of time to wait
      *  @return 0 on success
      */
-    virtual int32_t send(const void *data, uint32_t len, uint32_t timeout_ms) = 0;
+    virtual int32_t send(const void *data, uint32_t len) = 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
-     *  @param timeout_ms The longest time to wait for the data
      *  @return Number of bytes sent or a negative value on failure
      */
-    virtual int32_t recv(void *data, uint32_t len, uint32_t timeout_ms) = 0;
+    virtual int32_t recv(void *data, uint32_t len) = 0;
 };
 
 #endif