Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

configurePingInterval does not properly check if there's an active pingIntervalId #2739

Closed
NTaylorMullen opened this Issue · 1 comment

3 participants

@NTaylorMullen
Collaborator

Currently it checks an undefined value to determine that a pingIntervalId is not set, therefore it's "always" set. It must be changed to look at the appropriate variable.

AKA:
(current)

configurePingInterval = function (connection) {
            var config = connection._.config,
                onFail = function (error) {
                    $(connection).triggerHandler(events.onError, [error]);
                };

            if (!config.pingIntervalId && config.pingInterval) {
                connection._.pingIntervalId = window.setInterval(function () {
                    signalR.transports._logic.pingServer(connection).fail(onFail);
                }, config.pingInterval);
            }
        },

TO

configurePingInterval = function (connection) {
            var config = connection._.config,
                onFail = function (error) {
                    $(connection).triggerHandler(events.onError, [error]);
                };

            if (!connection._.pingIntervalId && config.pingInterval) {
                connection._.pingIntervalId = window.setInterval(function () {
                    signalR.transports._logic.pingServer(connection).fail(onFail);
                }, config.pingInterval);
            }
        },
@abnanda1 abnanda1 was assigned
@abnanda1 abnanda1 referenced this issue from a commit
@abnanda1 abnanda1 #2739 0af0667
@abnanda1 abnanda1 referenced this issue from a commit
@abnanda1 abnanda1 #2739 98aeb6b
@gustavo-armenta

tested connection._.pingIntervalId is initialized once, deleted when connection is stopped, and re-initialized when connection is started

@abnanda1 abnanda1 referenced this issue from a commit
@abnanda1 abnanda1 #2739 7b4dd40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.