From adfe0cd6726f421dbf532cfc44dab457468e8bd2 Mon Sep 17 00:00:00 2001 From: Rekey Date: Fri, 9 Dec 2016 13:47:40 +0800 Subject: [PATCH] Update sock.js retry to connect --- lib/sockets/sock.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/sockets/sock.js b/lib/sockets/sock.js index 881c34a..c642fc3 100644 --- a/lib/sockets/sock.js +++ b/lib/sockets/sock.js @@ -277,6 +277,9 @@ Socket.prototype.connect = function(port, host, fn){ debug('%s attempting reconnect', self.type); self.emit('reconnect attempt'); sock.destroy(); + if (typeof port === 'string') { + port = 'unix://' + port; + } self.connect(port, host); self.retry = Math.round(Math.min(max, retry * 1.5)); }, retry);