ap

Dependencies:   DnsQuery

Dependents:   WizFi310_TCP_Echo_Server_Example

Fork of NetworkSocketAPI by NetworkSocketAPI

Branch:
api-changes
Revision:
35:838393fbc2ca
Parent:
34:c17745683385
Child:
36:eab792dfb0d8
--- a/Socket.cpp	Mon Feb 22 19:56:44 2016 -0600
+++ b/Socket.cpp	Mon Feb 22 20:05:20 2016 -0600
@@ -87,18 +87,15 @@
         setPort(port);
     }
 
+    if (!_ip_address[0] || !_port) {
+        return -3;
+    }
 
     _socket = _iface->createSocket(_proto);
     if (!_socket) return -2;
 
-    if (_ip_address[0]) {
-        _socket->setIPAddress(_ip_address);
-    }
-
-    if (_port) {
-        _socket->setPort(_port);
-    }
-
+    _socket->setIPAddress(_ip_address);
+    _socket->setPort(_port);
 
     int32_t err = _socket->open();
     if (err) {