From 34b99fec8edcff7d3b667f273afea69df15e4d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 18 Jan 2020 18:35:12 +0100 Subject: rename dial to connect and dialTLS to connectTLS (#3710) --- std/http/racing_server_test.ts | 4 ++-- std/http/server_test.ts | 6 +++--- std/ws/mod.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'std') diff --git a/std/http/racing_server_test.ts b/std/http/racing_server_test.ts index b66986247..8b7ff9829 100644 --- a/std/http/racing_server_test.ts +++ b/std/http/racing_server_test.ts @@ -1,4 +1,4 @@ -const { dial, run } = Deno; +const { connect, run } = Deno; import { test, runIfMain } from "../testing/mod.ts"; import { assert, assertEquals } from "../testing/asserts.ts"; @@ -50,7 +50,7 @@ World 4 test(async function serverPipelineRace(): Promise { await startServer(); - const conn = await dial({ port: 4501 }); + const conn = await connect({ port: 4501 }); const r = new TextProtoReader(new BufReader(conn)); await conn.write(new TextEncoder().encode(input)); const outLines = output.split("\n"); diff --git a/std/http/server_test.ts b/std/http/server_test.ts index 5fe06f357..aee9db0ff 100644 --- a/std/http/server_test.ts +++ b/std/http/server_test.ts @@ -595,7 +595,7 @@ test({ await delay(100); // Reqeusts to the server and immediately closes the connection - const conn = await Deno.dial({ port: 4502 }); + const conn = await Deno.connect({ port: 4502 }); await conn.write(new TextEncoder().encode("GET / HTTP/1.0\n\n")); conn.close(); @@ -637,7 +637,7 @@ test({ .catch((_): void => {}); // Ignores the error when closing the process. // Requests to the server and immediately closes the connection - const conn = await Deno.dialTLS({ + const conn = await Deno.connectTLS({ hostname: "localhost", port: 4503, certFile: "http/testdata/tls/RootCA.pem" @@ -721,7 +721,7 @@ if (Deno.build.os !== "win") { assert(!(connRid in resources)); }; const p = serverRoutine(); - const conn = await Deno.dial({ + const conn = await Deno.connect({ hostname: "127.0.0.1", port: 8124 }); diff --git a/std/ws/mod.ts b/std/ws/mod.ts index c256f58ad..96ba4df62 100644 --- a/std/ws/mod.ts +++ b/std/ws/mod.ts @@ -484,10 +484,10 @@ export async function connectWebSocket( let conn: Conn; if (url.protocol === "http:" || url.protocol === "ws:") { const port = parseInt(url.port || "80"); - conn = await Deno.dial({ hostname, port }); + conn = await Deno.connect({ hostname, port }); } else if (url.protocol === "https:" || url.protocol === "wss:") { const port = parseInt(url.port || "443"); - conn = await Deno.dialTLS({ hostname, port }); + conn = await Deno.connectTLS({ hostname, port }); } else { throw new Error("ws: unsupported protocol: " + url.protocol); } -- cgit v1.2.3