Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of cc3000_hostdriver_mbedsocket by
Revision 28:8c7cc1c76ff8, committed 2013-10-05
- Comitter:
- Kojto
- Date:
- Sat Oct 05 20:29:39 2013 +0200
- Parent:
- 27:5118ab0f6aa4
- Child:
- 29:c40918cd9b6d
- Commit message:
- Commented select on UDP write (send), return in TCP receive
Changed in this revision
| Socket/TCPSocketConnection.cpp | Show annotated file Show diff for this revision Revisions of this file |
| Socket/UDPSocket.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Socket/TCPSocketConnection.cpp Fri Oct 04 07:06:29 2013 +0000
+++ b/Socket/TCPSocketConnection.cpp Sat Oct 05 20:29:39 2013 +0200
@@ -112,7 +112,11 @@
}
int n = _cc3000_module->_socket.recv(_sock_fd, data, length, 0);
- _is_connected = (n != 0);
+ if (n >= 0) {
+ _is_connected = 1;
+ } else {
+ _is_connected = 0;
+ }
return n;
}
--- a/Socket/UDPSocket.cpp Fri Oct 04 07:06:29 2013 +0000
+++ b/Socket/UDPSocket.cpp Sat Oct 05 20:29:39 2013 +0200
@@ -56,14 +56,14 @@
if (_sock_fd < 0) {
return -1;
}
-
- if (!_blocking) {
- TimeInterval timeout(_timeout);
- if (wait_writable(timeout) != 0) {
- DBG_SOCKET("The socket is not writeable. _sock_fd: %d", _sock_fd);
- return 0;
- }
- }
+ // TODO - seems to be a bug, waiting for TI to respond
+ // 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));
}
