I have a SignalR (v0.5.2) Hub sending a message to a JavaScript client.
c#
public Task SendData(ClassName classData){
return Clients["groupid"].renderData(classData);
}
javascript
var _client = $.connection.myHub;
_client.renderData = function(data){
/* do stuff */
};
$.connection.hub.start({ transport:activeTransport }, function(){ });
All works fine except that after a period of inactivity in IE9, the JavaScript method fails to run.
I have looked at the Response Body of the /signalr/connect?transport=foreverFrame network log within IE9 developer tools and can see that I am receiving the message:
<script>r(c, {"MessageId":"54","Messages":[{"Hub":"myHub","Method":"renderData","Args":[....]]}],"Disconnect":false,"TimedOut":false,"TransportData":{"Groups":["LiveBid.999"]}});</script>
<div>{"MessageId":"54","Messages":[{"Hub":"myHub","Method":"renderData","Args":[....]]}],"Disconnect":false,"TimedOut":false,"TransportData":{"Groups":["LiveBid.999"]}}</div>
Yet the JavaScript method never fires?
After a lot of time spent debugging this, it turns out that it is the version of my Modernizr file which is causing the problem.
I am not massively familiar with how the inners of Modernizer work, however I have created a custom version of the file that only has css/html5 elements features, and this currently seems to work with SignalR and foreverFrame.