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]

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

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

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

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

Sends a message to the target.