Skip to main content
Socket.prototype.unref - net - Node documentation
method Socket.prototype.unref

Usage in Deno

import { Socket } from "node:net";
Socket.prototype.unref(): this

Calling unref() on a socket will allow the program to exit if this is the only active socket in the event system. If the socket is already unrefed callingunref() again will have no effect.

Return Type

this

The socket itself.

Back to top