import { Deno } from "https://deno.land/x/deno@v1.0.0/cli/js/lib.deno.unstable.d.ts";
const { shutdown } = Deno;
UNSTABLE: Both the how
parameter and ShutdownMode
enum are under
consideration for removal.
Shutdown 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);