mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 10:33:54 +00:00
chore(runtime): deprecate Deno.copy
(#11369)
This commit is contained in:
parent
00484d24ba
commit
51e0bfda3c
10 changed files with 29 additions and 15 deletions
|
@ -1,5 +1,7 @@
|
|||
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
||||
// Used for benchmarking Deno's tcp proxy performance.
|
||||
import { copy } from "../../test_util/std/io/util.ts";
|
||||
|
||||
const addr = Deno.args[0] || "127.0.0.1:4500";
|
||||
const originAddr = Deno.args[1] || "127.0.0.1:4501";
|
||||
|
||||
|
@ -14,7 +16,7 @@ async function handle(conn: Deno.Conn): Promise<void> {
|
|||
port: Number(originPort),
|
||||
});
|
||||
try {
|
||||
await Promise.all([Deno.copy(conn, origin), Deno.copy(origin, conn)]);
|
||||
await Promise.all([copy(conn, origin), copy(origin, conn)]);
|
||||
} catch (e) {
|
||||
if (
|
||||
!(e instanceof Deno.errors.BrokenPipe) &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue