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

std/node/net.ts>Socket#ref

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
method Socket.prototype.ref
import { Socket } from "https://deno.land/std@0.116.0/node/net.ts";

Opposite of unref(), calling ref() on a previously unrefed socket will_not_ let the program exit if it's the only socket left (the default behavior). If the socket is refed calling ref again will have no effect.

Returns

this

The socket itself.