diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-09-20 18:32:18 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-20 18:32:18 -0400 |
commit | 97bb2bdb79cbd0a400c643e7be0029440cb15633 (patch) | |
tree | 92c883d38b7af413fcbfbac82f17775a7064dfec /tools/complex_permissions_test.ts | |
parent | 93b7acf99d6456e6e194c03f024b788ce5adf20e (diff) |
dial/listen API change (#3000)
Previously: dial("tcp", "deno.land:80")
Now: dial({ hostname: "deno.land", port: 80, transport: "tcp" })
Similarly with listen().
Diffstat (limited to 'tools/complex_permissions_test.ts')
-rw-r--r-- | tools/complex_permissions_test.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/complex_permissions_test.ts b/tools/complex_permissions_test.ts index dd65a0e33..a2e0f7824 100644 --- a/tools/complex_permissions_test.ts +++ b/tools/complex_permissions_test.ts @@ -16,13 +16,15 @@ const test: (args: string[]) => void = { }, netListen(hosts: string[]): void { hosts.forEach(host => { - const listener = Deno.listen("tcp", host); + const [hostname, port] = host.split(":"); + const listener = Deno.listen({ hostname, port: Number(port) }); listener.close(); }); }, async netDial(hosts: string[]): Promise<void> { for (const host of hosts) { - const listener = await Deno.dial("tcp", host); + const [hostname, port] = host.split(":"); + const listener = await Deno.dial({ hostname, port: Number(port) }); listener.close(); } } |