diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2020-02-25 09:14:27 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-25 09:14:27 -0500 |
commit | 91b606aaae23bcb790b55adc5fe70a182a37d564 (patch) | |
tree | 16b56a21ffcb3991569eda984fbd14073bdbd3ae /cli/js/tls.ts | |
parent | 805992b14a65a6dbfb857dea6d9b657477de043d (diff) |
Clean up how we use opIds (#4118)
Diffstat (limited to 'cli/js/tls.ts')
-rw-r--r-- | cli/js/tls.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cli/js/tls.ts b/cli/js/tls.ts index b8815831b..2780956a1 100644 --- a/cli/js/tls.ts +++ b/cli/js/tls.ts @@ -1,6 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { sendAsync, sendSync } from "./dispatch_json.ts"; -import * as dispatch from "./dispatch.ts"; import { Listener, Transport, Conn, ConnImpl, ListenerImpl } from "./net.ts"; // TODO(ry) There are many configuration options to add... @@ -18,13 +17,13 @@ const connectTLSDefaults = { hostname: "127.0.0.1", transport: "tcp" }; */ export async function connectTLS(options: ConnectTLSOptions): Promise<Conn> { options = Object.assign(connectTLSDefaults, options); - const res = await sendAsync(dispatch.OP_CONNECT_TLS, options); + const res = await sendAsync("op_connect_tls", options); return new ConnImpl(res.rid, res.remoteAddr!, res.localAddr!); } class TLSListenerImpl extends ListenerImpl { async accept(): Promise<Conn> { - const res = await sendAsync(dispatch.OP_ACCEPT_TLS, { rid: this.rid }); + const res = await sendAsync("op_accept_tls", { rid: this.rid }); return new ConnImpl(res.rid, res.remoteAddr, res.localAddr); } } @@ -53,7 +52,7 @@ export interface ListenTLSOptions { export function listenTLS(options: ListenTLSOptions): Listener { const hostname = options.hostname || "0.0.0.0"; const transport = options.transport || "tcp"; - const res = sendSync(dispatch.OP_LISTEN_TLS, { + const res = sendSync("op_listen_tls", { hostname, port: options.port, transport, |