ap

Dependencies:   DnsQuery

Dependents:   WizFi310_TCP_Echo_Server_Example

Fork of NetworkSocketAPI by NetworkSocketAPI

Branch:
api-changes
Revision:
39:47138420ea42
Parent:
38:157fb2ab965f
Child:
41:3ec1c97e9bbf
--- a/Socket.cpp	Mon Feb 22 20:51:09 2016 -0600
+++ b/Socket.cpp	Mon Feb 22 21:50:15 2016 -0600
@@ -63,7 +63,11 @@
 
 const char *Socket::getIPAddress() const
 {
-    return _ip_address;
+    if (_ip_address[0]) {
+        return _ip_address;
+    } else {
+        return 0;
+    }
 }
 
 uint16_t Socket::getPort() const
@@ -96,7 +100,7 @@
         setPort(port);
     }
 
-    if (!_ip_address[0] || !_port) {
+    if (!getIPAddress() || !getPort()) {
         return -3;
     }