summaryrefslogtreecommitdiff
path: root/docs/examples
diff options
context:
space:
mode:
authorMark Tomlin <Mark@MimoCAD.io>2021-01-05 06:09:50 -0500
committerGitHub <noreply@github.com>2021-01-05 12:09:50 +0100
commit37a9d6678ed4f634100d4b6ecb5abd7b0b45faad (patch)
treec4f7db0d6fac6c8891d4c375d175f91b0469ee8a /docs/examples
parenta3099798c881ac1be7108c0255e67e182c7080da (diff)
docs(example/tcp_echo): fix TCP echo leaking resources (#8997)
Diffstat (limited to 'docs/examples')
-rw-r--r--docs/examples/tcp_echo.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/examples/tcp_echo.md b/docs/examples/tcp_echo.md
index 7e3267c51..a66fe05ed 100644
--- a/docs/examples/tcp_echo.md
+++ b/docs/examples/tcp_echo.md
@@ -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());
}
```