![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
wireless
Dependencies: EthernetInterface mbed-rtos mbed
Fork of TCPEchoServer by
Diff: main.cpp
- Revision:
- 6:30f62685b255
- Parent:
- 3:36fd3cfad85a
diff -r 0f0fdadab553 -r 30f62685b255 main.cpp --- a/main.cpp Fri Mar 01 15:37:15 2013 +0000 +++ b/main.cpp Fri May 16 19:34:28 2014 +0000 @@ -1,5 +1,6 @@ #include "mbed.h" #include "EthernetInterface.h" +#include <cctype> #define ECHO_SERVER_PORT 7 @@ -17,7 +18,7 @@ printf("\nWait for new connection...\n"); TCPSocketConnection client; server.accept(client); - client.set_blocking(false, 1500); // Timeout after (1.5)s + client.set_blocking(false, 100000); // NB Timeout printf("Connection from: %s\n", client.get_address()); char buffer[256]; @@ -25,6 +26,11 @@ int n = client.receive(buffer, sizeof(buffer)); if (n <= 0) break; + char *p = buffer; + while (*p) { + *p = toupper(*p); + p++; + } client.send_all(buffer, n); if (n <= 0) break; }