SignalR 2 - Waiting for AJX requests after opening multiple tabs

I use SignalR 2 and I am having problems opening multiple tabs on the same page. After opening 4 or 5 tabs, all requests fall into a pending status, for example, if I have exceeded the maximum allowable browser. If I close a few tabs, everything will work again. Even if all open tabs are open, if I open another browser, it works. This happens in both Chrome and Firefox. If I disable SignalR, I can open as many tabs as I want.

This is my code:

// Reference the auto-generated proxy for the hub.  
    notificator.hub = $.connection.messageHub;
    // Create a function that the hub can call back to display messages.
    notificator.hub.client.refreshNotifications = function () {
              // business code

    };

    $.connection.hub.start().done(function () {
        notificator.hubStarted = true;
    });
    $.connection.hub.disconnected(function () {
        notificator.hubStarted = false;
        setTimeout(function () {
            $.connection.hub.start();
        }, 2000); // Restart connection after 2 seconds.
    });

If I delete the handler for the disabled event, the problem remains. The notification system works correctly, so SignalR does its job, but this causes problems in the application. This is even slower.

+1
1

:

1) - , , WebSockets, WebSockets . ? , SignalR, :

$.connection.hub.logging = true;

WebSockets:

$.connection.hub.start({ transport: 'webSockets' }).done(function () { .. });

, , , WebSockets , . , Windows 2012 :

  • .
  • "" " ".
  • , .
  • ( ), "".
  • - (IIS) Roles, -, Application Development.
  • " WebSocket" "".
  • "".

: http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-websocket-protocol-support

. Chrome "" WS-. , -.

2) IWC-SignalR:

https://github.com/slimjack/IWC-SignalR

:

( ) SignalR. - . IWC.

+2

Source: https://habr.com/ru/post/1664042/


All Articles