summaryrefslogtreecommitdiff
path: root/docs/examples/tcp_echo.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/examples/tcp_echo.md')
-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());
}
```