From ff289c6b23ea03a02ee578deeae5fcb6b8a3ea30 Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Fri, 28 Mar 2014 17:11:19 +0100 Subject: [PATCH] unrefing timeout to not hang on stop --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index d1bad34..64b8331 100644 --- a/index.js +++ b/index.js @@ -150,6 +150,10 @@ Client.prototype._requestUdp = function (announceUrl, opts) { error('tracker request timed out') }, 15000) + if (timeout.unref) { + timeout.unref() + } + function error (message) { self.emit('error', new Error(message)) socket.close()