diff --git a/lib/connection/connection.js b/lib/connection/connection.js index c5d517324..55a30ca43 100644 --- a/lib/connection/connection.js +++ b/lib/connection/connection.js @@ -176,7 +176,7 @@ function Connection(context) { function connectCallback(self, callback) { return function (err) { if (Parameters.getValue(Parameters.names.CLIENT_SESSION_KEEP_ALIVE)) { - self.keepalive = setInterval(self.heartbeat, Parameters.getValue(Parameters.names.CLIENT_SESSION_KEEP_ALIVE_HEARTBEAT_FREQUENCY) * 1000, self); + self.keepalive = setInterval(self.heartbeat, Parameters.getValue(Parameters.names.CLIENT_SESSION_KEEP_ALIVE_HEARTBEAT_FREQUENCY) * 1000, callback); } if (Util.isFunction(callback)) { callback(Errors.externalize(err), self);