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

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

A modern runtime for JavaScript and TypeScript.
Go to Latest
function shutdown
import { shutdown } from "https://deno.land/x/deno@v0.28.0/cli/js/net.ts";

Shut down socket send and receive operations.

Matches behavior of POSIX shutdown(3).

  const listener = Deno.listen({ port: 80 });
  const conn = await listener.accept();
  Deno.shutdown(conn.rid, Deno.ShutdownMode.Write);

Parameters

rid: number