NetworkSocketAPI
Dependents: HelloWizFi250Interface
Fork of NetworkSocketAPI by
Revision 35:838393fbc2ca, committed 2016-02-22
- Comitter:
- Christopher Haster
- Date:
- Mon Feb 22 20:05:20 2016 -0600
- Branch:
- api-changes
- Parent:
- 34:c17745683385
- Child:
- 36:eab792dfb0d8
- Commit message:
- Added error on connect without ip/port
Changed in this revision
Socket.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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) {