Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Deno.DatagramConn

UNSTABLE: new API, yet to be vetted.

A generic transport listener for message-oriented protocols.

interface DatagramConn extends AsyncIterable<[Uint8Array, Addr]> {
readonly addr: Addr;
[[Symbol.asyncIterator]](): AsyncIterableIterator<[Uint8Array, Addr]>;
close(): void;
receive(p?: Uint8Array): Promise<[Uint8Array, Addr]>;
send(p: Uint8Array, addr: Addr): Promise<number>;
}

§Extends

§
AsyncIterable<[Uint8Array, Addr]>
[src]

§Properties

§
readonly addr: Addr
[src]

Return the address of the UDPConn.

§Methods

§
[[Symbol.asyncIterator]](): AsyncIterableIterator<[Uint8Array, Addr]>
[src]
§
close(): void
[src]

UNSTABLE: new API, yet to be vetted.

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

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

UNSTABLE: new API, yet to be vetted.

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

§
send(p: Uint8Array, addr: Addr): Promise<number>
[src]

UNSTABLE: new API, yet to be vetted.

Sends a message to the target.