From a8c3c62f37cbcb0889bc5d96d0928e94b59b45aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20St-Germain?= Date: Wed, 17 Jun 2015 17:27:59 -0400 Subject: [PATCH] Update logstash.js in node 0.10 the CleartextStream object returned by tls.connect doesn't have an unref() function --- lib/logstash.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/logstash.js b/lib/logstash.js index 69cdf40..d396b1a 100644 --- a/lib/logstash.js +++ b/lib/logstash.js @@ -132,7 +132,10 @@ LogstashStream.prototype.connect = function () { } else { this.socket = new net.Socket(); } - this.socket.unref(); + + if (_.isFunction(this.socket.unref)) { + this.socket.unref(); + } this.socket.on('error', function (err) { self.connecting = false;