docs(example/tcp_echo): fix TCP echo leaking resources (#8997)

This commit is contained in:
Mark Tomlin 2021-01-05 06:09:50 -05:00 committed by GitHub
parent a3099798c8
commit 37a9d6678e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,7 +19,7 @@ returns to the client anything it sends.
const listener = Deno.listen({ port: 8080 });
console.log("listening on 0.0.0.0:8080");
for await (const conn of listener) {
Deno.copy(conn, conn);
Deno.copy(conn, conn).finally(() => conn.close());
}
```