Skip to main content

DatagramConn

interface Deno.DatagramConn
extends AsyncIterable<[Uint8Array, Addr]>
unstable

A generic transport listener for message-oriented protocols.

Properties Jump to heading

Return the address of the instance.

Jump to headingjoinMulticastV4(
address: string,
networkInterface: string,
): Promise<MulticastV4Membership>

Joins an IPv4 multicast group.

Jump to headingjoinMulticastV6(
address: string,
networkInterface: number,
): Promise<MulticastV6Membership>

Joins an IPv6 multicast group.

Jump to headingreceive(p?: Uint8Array): Promise<[Uint8Array, Addr]>

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

Messages are received in the format of a tuple containing the data array and the address information.

Jump to headingsend(
p: Uint8Array,
addr: Addr,
): Promise<number>

Sends a message to the target via the connection. The method resolves with the number of bytes sent.

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

Jump to heading[[Symbol.asyncIterator]](): AsyncIterableIterator<[Uint8Array, Addr]>
Back to top