Skip to main content
Socket.prototype.close - node__dgram.d.ts - Node documentation
method Socket.prototype.close

Usage in Deno

```typescript import { Socket } from "node:node__dgram.d.ts"; ```
Socket.prototype.close(callback?: () => void): this
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.

Return Type

this