Skip to main content
Module

std/node/dgram.ts>Socket#close

Deno standard library
Go to Latest
method Socket.prototype.close
import { Socket } from "https://deno.land/std@0.166.0/node/dgram.ts";

Close the underlying socket and stop listening for data on it. If a callback is provided, it is added as a listener for the 'close' event.

Parameters

optional
callback: () => void

Called when the socket has been closed.