Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

signalr is not working on fresh index.html page #1767


User avatar
0
andry3ag created

Hi all,

I need to restyle the app into different theme by create a fresh index.html page. In the process, I need to migrate signalr related functionality. I could not get it working. (it worked intermittently actually, probably 1 out of 10 page refreshes)

here is what I did.

... jquery and others above it.
        <script src="../../Scripts/jquery.signalR-2.2.1.min.js" type="text/javascript"></script>
        <script src="/signalr/hubs"></script>
        <script src="../../Abp/Framework/scripts/libs/abp.signalr.js" type="text/javascript"></script>

I set the break point in the following function and the code 'abp.event.trigger('abp.notifications.received', notification);' which didn't get called:

commonHub.client.getNotification = function (notification) {
        abp.event.trigger('abp.notifications.received', notification);
    };

The following line was called, when I set the break point.

subscriptionMethod.call(hub, memberKey, makeProxyCallback(hub, memberValue));

In the chrome, WS tab the message is received and if I use the ASP.NET Zero page, it worked every time. Therefore it ruled out the server issue. However when it was in my own page it didn't work properly as I stated above the code 'abp.event.trigger('abp.notifications.received', notification);' which didn't get called.

Any hint will be appreciated!

derek


2 Answer(s)
  • User Avatar
    0
    andry3ag created

    I think it is related to max parallel http connections in a browser. It is across different tabs too. So while testing/developing, make sure you don't hit the limt.

    [http://stackoverflow.com/questions/985431/max-parallel-http-connections-in-a-browser])

    derek

  • User Avatar
    0
    hikalkan created
    Support Team

    abp.event.trigger is only called when a notification received. abp logs a message to indicate connection is established. Can you see it? Also, be sure that you included jquery, abp, signalr scripts in the same order in aspNet Zero's layout.