Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/deno/cli/js/lib.deno.unstable.d.ts>Deno.DatagramConn

A modern runtime for JavaScript and TypeScript.
Go to Latest
interface Deno.DatagramConn
implements AsyncIterable<[Uint8Array, Addr]>
import { type Deno } from "https://deno.land/x/deno@v1.0.0/cli/js/lib.deno.unstable.d.ts";
const { DatagramConn } = Deno;

UNSTABLE:: new API, yet to be vetted.

A generic transport listener for message-oriented protocols.

Properties

readonly
addr: Addr

Return the address of the UDPConn.

Methods

receive(p?: Uint8Array): Promise<[Uint8Array, Addr]>

UNSTABLE: new API, yet to be vetted.

Waits for and resolves to the next message to the UDPConn.

send(p: Uint8Array, addr: Addr): Promise<void>

UNSTABLE: new API, yet to be vetted.

Sends a message to the target.

close(): void

UNSTABLE: new API, yet to be vetted.

Close closes the socket. Any pending message promises will be rejected with errors.

[[Symbol.asyncIterator]](): AsyncIterableIterator<[Uint8Array, Addr]>