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.
Diff: main.cpp
- Revision:
- 1:ec61ea9f67de
- Parent:
- 0:6e8275981824
- Child:
- 2:d45fed6919ef
diff -r 6e8275981824 -r ec61ea9f67de main.cpp
--- a/main.cpp Thu Sep 22 11:20:29 2016 +0000
+++ b/main.cpp Mon Nov 14 15:34:13 2016 +0000
@@ -1,5 +1,5 @@
-#if !FEATURE_IPV4
- #error [NOT_SUPPORTED] IPV4 not supported for this target
+#if !FEATURE_LWIP
+ #error [NOT_SUPPORTED] LWIP not supported for this target
#endif
#include "mbed.h"
@@ -35,7 +35,7 @@
TCPServer srv;
TCPSocket clt_sock;
- //SocketAddress clt_addr;
+ SocketAddress clt_addr;
/* Open the server on ethernet stack */
srv.open(ð);
@@ -47,11 +47,8 @@
srv.listen(5);
while (true) {
- // Will be possible in releaseb 126
- //srv.accept(&clt_sock, &clt_addr);
- //printf("accept %s:%d\n", clt_addr.get_ip_address(), clt_addr.get_port());
- srv.accept(&clt_sock);
- printf("new client accepted\n");
+ srv.accept(&clt_sock, &clt_addr);
+ printf("accept %s:%d\n", clt_addr.get_ip_address(), clt_addr.get_port());
clt_sock.send(HTTP_RESPONSE, strlen(HTTP_RESPONSE));
}
}