diff options
author | Andy Hayden <andyhayden1@gmail.com> | 2019-10-28 12:58:35 -0700 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2019-10-28 15:58:35 -0400 |
commit | f484776384ad7df35ab7626b7a673f3902a6cfaa (patch) | |
tree | cb74f31550dc666ec75f5a2f95d61dc69931cb16 /std/examples/echo_server.ts | |
parent | 71efe6f2c530d1cb9e8a2679f5778e2c034a9d0d (diff) |
Use top-level for-await in various places (#3217)
Diffstat (limited to 'std/examples/echo_server.ts')
-rw-r--r-- | std/examples/echo_server.ts | 3 |
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); } |