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: EthernetNetIf SimpleSocket 1.0 mbed
Diff: Example/echoserver.cpp
- Revision:
- 17:50c0e9c5ca79
- Parent:
- 15:ae9aff693b07
- Child:
- 21:a3cf1f055a4d
--- a/Example/echoserver.cpp Fri Aug 19 11:23:38 2011 +0000 +++ b/Example/echoserver.cpp Thu Sep 01 04:34:43 2011 +0000 @@ -12,14 +12,15 @@ timer.start(); while (true) { - if (ClientSocket *socket = server.accept()) { - while (socket->connected()) { + if (ClientSocket socket = server.accept()) { + while (socket.connected()) { char buf[8]; - int len = socket->read(buf, sizeof(buf)); + int len = socket.read(buf, sizeof(buf)); if (len > 0) - socket->write(buf, len); + socket.write(buf, len); blink(led1, timer); } + socket.close(); } blink(led2, timer); }