joyent/node — pull request #3707 by tjfontaine (2012-07-13 19:31:22+00:00)
Title: Expose ref/unref for Socket, Server, and Timers

This exposes the underlying handle `ref` and `unref` for `dgram.Socket`, `net.Socket`, `net.Server`, and `timers`.

Ideal for users who want to create such items but not have them keep the program running. For instance a logging connection, a keep-alive'd socket, or a timer that monitors statistics.

Calling `unref()` on one of these objects will unreference the handle in the event loop, calling `ref()` will restore it and hold the loop open as usual.

Fixes #2718