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.
Dependencies: WIFI_API_32kRAM mbed
Fork of HTTP-Server by
Diff: HTTPServer.cpp
- Revision:
- 9:a9bf63017854
- Parent:
- 8:464abd184b7b
diff -r 464abd184b7b -r a9bf63017854 HTTPServer.cpp --- a/HTTPServer.cpp Thu Jul 18 08:30:11 2013 +0000 +++ b/HTTPServer.cpp Thu Jul 18 09:39:35 2013 +0000 @@ -30,7 +30,19 @@ bool HTTPServer::init(int port) { socket.set_blocking(true); - return !socket.bind(port) && !socket.listen(); + if(socket.bind(port)) + { + printf("Could not bind on port %d.\n", port); + return false; + } + + if(socket.listen()) + { + printf("Could not listen %d\n", port); + return false; + } + + return true; } void HTTPServer::run()