RPC mbed Server (basierend auf HTTP Protokoll) mit UI via Browser
Dependencies: EthernetInterface mbed-rpc mbed-rtos 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()