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 EthernetInterfaceW5500 by
Revision 15:fe68ac753657, committed 2014-08-29
- Comitter:
- ppo
- Date:
- Fri Aug 29 12:00:38 2014 +0000
- Parent:
- 14:a089e591e530
- Commit message:
- bug fixed in close(), now socket is really closed
Changed in this revision
Socket/Socket.cpp | Show annotated file Show diff for this revision Revisions of this file |
Socket/TCPSocketServer.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Socket/Socket.cpp Tue Aug 19 23:32:48 2014 +0000 +++ b/Socket/Socket.cpp Fri Aug 29 12:00:38 2014 +0000 @@ -35,8 +35,10 @@ int Socket::close() { // add this code refer from EthernetInterface. + int res; + res = eth->close(_sock_fd); _sock_fd = -1; - return (eth->close(_sock_fd)) ? 0 : -1; + return (res)? 0: -1; } Socket::~Socket()
--- a/Socket/TCPSocketServer.cpp Tue Aug 19 23:32:48 2014 +0000 +++ b/Socket/TCPSocketServer.cpp Fri Aug 29 12:00:38 2014 +0000 @@ -81,12 +81,15 @@ // and then, for the next connection, server socket should be assigned new one. _sock_fd = -1; // want to assign new available _sock_fd. if(bind(listen_port) < 0) { - error("No more socket for listening"); + error("No more socket for listening, bind error"); + return -1; } else { //return -1; if(listen(1) < 0) { - error("No more socket for listening"); + error("No more socket for listening, listen error"); + return -1; } + } return 0; }