![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
SimpleSocket 1.0 examples
Dependencies: EthernetNetIf SimpleSocket 1.0 mbed
Diff: webserver.cpp
- Revision:
- 34:a108bcc26b69
- Parent:
- 33:39d9cdf99de8
- Child:
- 35:3fc65b5d6340
diff -r 39d9cdf99de8 -r a108bcc26b69 webserver.cpp --- a/webserver.cpp Wed Nov 02 12:16:51 2011 +0000 +++ b/webserver.cpp Fri Nov 04 06:04:36 2011 +0000 @@ -12,12 +12,13 @@ "</head>\r\n" "<body>\r\n" "<h2>Analog Input</h2>\r\n" - "<table cellpadding=\"5\">"; + "<table cellpadding=\"5\">\r\n"; char *response1 = "<tr style=\"background:#ccccff\">" "<th>pin</th><th>value</th>" "</tr>\r\n"; -char *response2 = "<tr style=\"background:#cccccc\">" +char *response2 = + "<tr style=\"background:#cccccc\">" "<td>p%d</td><td align=\"center\">%f</td>" "</tr>\r\n"; char *response3 = @@ -28,7 +29,9 @@ void webserver() { EthernetNetIf eth; eth.setup(); + ServerSocket server(80); + while (true) { ClientSocket socket = server.accept(); while (socket) {