socket.ref()
- 返回: <net.Socket> Socket 本身。
与 unref()
相反,在一个已经调用 unref
的 socket 中调用 ref()
,如果 socket 是仅存的 socket,则程序不会退出(默认)。
对一个已经调用 ref
的 socket 再次调用 ref
将不会再有效果。
- Returns: <net.Socket> The socket itself.
Opposite of unref()
, calling ref()
on a previously unref
ed socket will
not let the program exit if it's the only socket left (the default behavior).
If the socket is ref
ed calling ref
again will have no effect.