Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/cli/js/net.ts>Listener

A modern runtime for JavaScript and TypeScript.
Go to Latest
interface Listener
implements AsyncIterator<Conn>
import { type Listener } from "https://deno.land/x/deno@v0.28.0/cli/js/net.ts";

A Listener is a generic transport listener for stream-oriented protocols.

Methods

accept(): Promise<Conn>

Waits for and resolves to the next connection to the Listener.

close(): void

Close closes the listener. Any pending accept promises will be rejected with errors.

addr(): Addr

Return the address of the Listener.

[[Symbol.asyncIterator]](): AsyncIterator<Conn>