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.
Revision 139:dafbbf31bf76, committed 2016-02-25
- Comitter:
- walser
- Date:
- Thu Feb 25 13:22:34 2016 +0000
- Parent:
- 138:6a7a5c4f35f6
- Child:
- 140:fd9fe498f142
- Commit message:
- Improve connection checking of TCP socket.
Changed in this revision
| Socket/TCPSocketConnection.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Socket/TCPSocketConnection.h Mon Jan 25 13:30:55 2016 +0000
+++ b/Socket/TCPSocketConnection.h Thu Feb 25 13:22:34 2016 +0000
@@ -42,7 +42,12 @@
/** Check if the socket is connected
\return true if connected, false otherwise.
*/
- bool is_connected(void) { return _mdm->socketIsConnected(_socket); }
+ bool is_connected(void)
+ {
+ if (_socket < 0)
+ return false;
+ return _mdm->socketIsConnected(_socket);
+ }
/** Send data to the remote host.
\param data The buffer to send to the host.