Skip to main content
Module

x/denoversion/lib/lib.deno_runtime.d.ts>deno.dial

Deno cli to manage and bump release versions.
Latest
function deno.dial
import { deno } from "https://deno.land/x/denoversion@v1.0.2/lib/lib.deno_runtime.d.ts";
const { dial } = deno;

Dial connects to the address on the named network.

Supported networks are only tcp currently.

TODO: tcp4 (IPv4-only), tcp6 (IPv6-only), udp, udp4 (IPv4-only), udp6 (IPv6-only), ip, ip4 (IPv4-only), ip6 (IPv6-only), unix, unixgram and unixpacket.

For TCP and UDP networks, the address has the form host:port. The host must be a literal IP address, or a host name that can be resolved to IP addresses. The port must be a literal port number or a service name. If the host is a literal IPv6 address it must be enclosed in square brackets, as in [2001:db8::1]:80 or [fe80::1%zone]:80. The zone specifies the scope of the literal IPv6 address as defined in RFC 4007. The functions JoinHostPort and SplitHostPort manipulate a pair of host and port in this form. When using TCP, and the host resolves to multiple IP addresses, Dial will try each IP address in order until one succeeds.

Examples:

dial("tcp", "golang.org:http")
dial("tcp", "192.0.2.1:http")
dial("tcp", "198.51.100.1:80")
dial("udp", "[2001:db8::1]:domain")
dial("udp", "[fe80::1%lo0]:53")
dial("tcp", ":80")

Parameters

network: Network
address: string

Returns

Promise<Conn>