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 Socket by
Diff: TCPSocketServer.cpp
- Revision:
- 10:d24738f4ef99
- Parent:
- 6:cd2e5559786d
- Child:
- 11:3d83c348fb8b
--- a/TCPSocketServer.cpp Fri Jul 27 15:56:20 2012 +0000 +++ b/TCPSocketServer.cpp Tue Jul 31 11:50:55 2012 +0000 @@ -57,14 +57,15 @@ return 0; } -int TCPSocketServer::accept(TCPSocketConnection& connection, int timeout_ms) { +int TCPSocketServer::accept(TCPSocketConnection& connection) { if (_sock_fd < 0) return -1; - TimeInterval timeout(timeout_ms); - if (wait_readable(timeout) != 0) - return -1; - + if (!_blocking) { + TimeInterval timeout(_timeout); + if (wait_readable(timeout) != 0) + return -1; + } socklen_t newSockRemoteHostLen = sizeof(connection._remoteHost); int fd = lwip_accept(_sock_fd, (struct sockaddr*) &connection._remoteHost, &newSockRemoteHostLen); if (fd < 0)