Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SignalR - Forever Frame in IE stops working after a few minutes of being idle

I am using SignalR in IE9 and, unfortunately, it has to degrade to using the forever frame connection.

I have spent some time looking at this with the Developer Tools in IE. I can see the callbacks loading into the dynamically inserted IFrame, and they call the receive function in the SignalR plugin. However after about 20/30 of these it just stops responding - I can no longer call client script from the server.

I'm guessing that the IFrame load is finally timing out, but there appear to be no events raised for this, so I cannot force a reconnect.

Has anyone managed to get a robust SignalR connection working in IE?

Thanks :)

like image 345
Kram Avatar asked Sep 04 '12 17:09

Kram


1 Answers

We had an issue where the Javascript on a website would stop working, specifically we noted this in that Ajax calls would not work. After some investigation we found that SignalR was the reason for the crash, and we found this post about Forever Frames. We tried removing Forever Frames support in SignalR with the following code in the clients JavaScript:

$.connection.hub.start({ transport: ['webSockets', 'serverSentEvents', 'longPolling'] });

Thus only supporting 'webSockets', 'serverSentEvents', 'longPolling'.

like image 78
Doff3n Avatar answered Nov 15 '22 12:11

Doff3n