Use top-level for-await in various places (#3217)

This commit is contained in:
Andy Hayden 2019-10-28 12:58:35 -07:00 committed by Ry Dahl
parent 71efe6f2c5
commit f484776384
9 changed files with 94 additions and 125 deletions

View file

@ -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);
}