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
Revision 20:6bf8566b40c8, committed 2015-03-05
- Comitter:
- marcelobarrosalmeida
- Date:
- Thu Mar 05 20:55:36 2015 +0000
- Parent:
- 19:434906b5b977
- Commit message:
- Socket::close() now supports an additional parameter for defining the shutdown type
Changed in this revision
Socket.cpp | Show annotated file Show diff for this revision Revisions of this file |
Socket.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Socket.cpp Mon Aug 19 18:38:18 2013 +0300 +++ b/Socket.cpp Thu Mar 05 20:55:36 2015 +0000 @@ -69,12 +69,12 @@ return select(&timeout._time, false, true); } -int Socket::close(bool shutdown) { +int Socket::close(bool shutdown, int shutdown_type) { if (_sock_fd < 0) return -1; if (shutdown) - lwip_shutdown(_sock_fd, SHUT_RDWR); + lwip_shutdown(_sock_fd, shutdown_type); lwip_close(_sock_fd); _sock_fd = -1;
--- a/Socket.h Mon Aug 19 18:38:18 2013 +0300 +++ b/Socket.h Thu Mar 05 20:55:36 2015 +0000 @@ -67,8 +67,9 @@ /** Close the socket \param shutdown free the left-over data in message queues + \param shutdown_type which channels will be closed (\ref SHUT_RD, \ref SHUT_WR or \ref SHUT_RDWR) */ - int close(bool shutdown=true); + int close(bool shutdown=true, int shutdown_type=SHUT_RDWR); ~Socket();