NetworkSocketAPI

Dependencies:   DnsQuery

Dependents:   HelloWizFi250Interface

Fork of NetworkSocketAPI by NetworkSocketAPI

Files at this revision

API Documentation at this revision

Comitter:
Christopher Haster
Date:
Mon Feb 22 20:08:04 2016 -0600
Branch:
api-changes
Parent:
35:838393fbc2ca
Child:
37:50b481a8e784
Commit message:
Added passing of ip/port into SocketInterface::open for implementation convenience

Changed in this revision

Socket.cpp Show annotated file Show diff for this revision Revisions of this file
SocketInterface.h Show annotated file Show diff for this revision Revisions of this file
--- a/Socket.cpp	Mon Feb 22 20:05:20 2016 -0600
+++ b/Socket.cpp	Mon Feb 22 20:08:04 2016 -0600
@@ -94,10 +94,8 @@
     _socket = _iface->createSocket(_proto);
     if (!_socket) return -2;
 
-    _socket->setIPAddress(_ip_address);
-    _socket->setPort(_port);
+    int32_t err = _socket->open(_ip_address, _port);
 
-    int32_t err = _socket->open();
     if (err) {
         _iface->destroySocket(_socket);
     }
--- a/SocketInterface.h	Mon Feb 22 20:05:20 2016 -0600
+++ b/SocketInterface.h	Mon Feb 22 20:08:04 2016 -0600
@@ -47,9 +47,11 @@
     virtual void setPort(uint16_t port);
 
     /** Open a connection to the underlying address
+     *  @param ip IP address to connect to
+     *  @param port Port to connect to
      *  @return 0 on success
      */
-    virtual int32_t open() = 0;
+    virtual int32_t open(const char *ip, uint16_t port) = 0;
 
     /** Close an open connection
      *  @return 0 on success