unrefing timeout to not hang on stop

This commit is contained in:
Mathias Buus 2014-03-28 17:11:19 +01:00
parent 9a4688ff8e
commit ff289c6b23

View File

@ -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()