docs(example/tcp_echo): fix TCP echo leaking resources
@@ -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());
}
```
