summaryrefslogtreecommitdiff
path: root/std/examples/echo_server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/examples/echo_server.ts')
-rw-r--r--std/examples/echo_server.ts3
1 files changed, 1 insertions, 2 deletions
diff --git a/std/examples/echo_server.ts b/std/examples/echo_server.ts
index 3bed1bca2..1eafae50c 100644
--- a/std/examples/echo_server.ts
+++ b/std/examples/echo_server.ts
@@ -3,7 +3,6 @@ const hostname = "0.0.0.0";
const port = 8080;
const listener = Deno.listen({ hostname, port });
console.log(`Listening on ${hostname}:${port}`);
-while (true) {
- const conn = await listener.accept();
+for await (const conn of listener) {
Deno.copy(conn, conn);
}