34rtyujk
Fork of WizFi310Interface_Legacy by
Diff: Socket/TCPSocketConnection.cpp
- Revision:
- 2:4ec2fd843038
- Parent:
- 0:774ff1e8b26b
--- a/Socket/TCPSocketConnection.cpp Tue May 02 00:31:36 2017 +0000 +++ b/Socket/TCPSocketConnection.cpp Mon Nov 27 05:28:45 2017 +0000 @@ -28,6 +28,8 @@ TCPSocketConnection::TCPSocketConnection() {} + + int TCPSocketConnection::connect(const char* host, const int port) { if (set_address(host, port) != 0) return -1; @@ -40,10 +42,10 @@ } bool TCPSocketConnection::is_connected(void) -{ +{ printf("_cid: %d\n", _cid); bool _is_connected = _wizfi310->isConnected(_cid); if(!_is_connected) _cid = -1; - + printf(" is_connected: %d\n",_is_connected); return _is_connected; } @@ -99,7 +101,7 @@ } if(time >= _timeout) { - //WIZ_DBG("receive timeout"); + WIZ_DBG("receive timeout"); return 0; } } @@ -141,7 +143,7 @@ if( _wizfi310->cmdSMGMT(cid) ) return; if( !_wizfi310->getRemote(_cid, &ip, &port)) - { + { set_address(ip, port); } }