version_2.0
Dependents: cc3000_ping_demo_try_2
Fork of cc3000_hostdriver_mbedsocket by
Diff: Socket/UDPSocket.cpp
- Revision:
- 16:f3676ae62f96
- Parent:
- 13:5e36c267e62f
- Parent:
- 12:1c2a856c618a
- Child:
- 28:8c7cc1c76ff8
--- a/Socket/UDPSocket.cpp Wed Oct 02 15:29:26 2013 +0000 +++ b/Socket/UDPSocket.cpp Wed Oct 02 16:00:41 2013 +0000 @@ -57,15 +57,13 @@ return -1; } -// if (!_blocking) { -// TimeInterval timeout(_timeout); -// if (wait_writable(timeout) != 0) { -//#if (CC3000_DEBUG == 1) -// printf("DEBUG: The socket is not writeable. _sock_fd: %d.\n", _sock_fd); -//#endif -// return 0; -// } -// } + if (!_blocking) { + TimeInterval timeout(_timeout); + if (wait_writable(timeout) != 0) { + DBG_SOCKET("The socket is not writeable. _sock_fd: %d", _sock_fd); + return 0; + } + } return _cc3000_module->_socket.sendto(_sock_fd, packet, length, 0, (sockaddr *)&remote._remote_host, sizeof(sockaddr)); }