From 3538060002e506d97d46aece592f5a1556ff805f Mon Sep 17 00:00:00 2001 From: Carl Kittelberger Date: Sat, 9 Apr 2016 17:04:16 +0200 Subject: [PATCH] Stop keepalive when "close" event triggers on TCP socket. --- ts3query.iced | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ts3query.iced b/ts3query.iced index 599fc36..84bddb2 100644 --- a/ts3query.iced +++ b/ts3query.iced @@ -108,7 +108,9 @@ module.exports = class TS3ClientQuery extends EventEmitter connect: (cb) => @_tcpClient = new net.Socket - @_tcpClient.on "close", () => @emit "close" + @_tcpClient.on "close", () => + @_stopKeepalive() + @emit "close" @_tcpClient.on "error", (err) => @_log.warn "Connection error", err @_stopKeepalive()