diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-10-11 16:55:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-11 16:55:22 -0400 |
commit | c814d5a9140d88bf1633b74742e64436e1c75667 (patch) | |
tree | 71bd96c9f4cd566b5ae231990a8a4a7e7feff8c4 /tests/echo_server.ts | |
parent | 51f9331ecb50afeafd0fa2ca8336e75aa374465e (diff) |
Add throughput benchmark (#961)
Diffstat (limited to 'tests/echo_server.ts')
-rw-r--r-- | tests/echo_server.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/echo_server.ts b/tests/echo_server.ts new file mode 100644 index 000000000..7761c1ad7 --- /dev/null +++ b/tests/echo_server.ts @@ -0,0 +1,9 @@ +import { args, listen, copy } from "deno"; +const addr = args[1] || "127.0.0.1:4544"; +const listener = listen("tcp", addr); +console.log("listening on", addr); +listener.accept().then(async conn => { + await copy(conn, conn); + conn.close(); + listener.close(); +}); |