For some reason, SignalR will just stop calling client methods after a short period of time (about 1 hour or less I estimate). I have a page that shows Alerts... a very simple implementation. Here's the Javascript:
$(function () {
// enable logging for debugging
$.connection.hub.logging = true;
// Declare a proxy to reference the hub.
var hub = $.connection.alertHub;
hub.client.addAlert = function (id, title, url, dateTime) {
console.log(title);
};
$.connection.hub.start().done(function () {
console.log("Alert Ready");
});
});
If I refresh the page, it works again for about an hour, then will stop calling the client event addAlert. There are no errors in the log, no warnings. The last event in log (other than the pings to the server) is:
[15:18:58 GMT-0600 (CST)] SignalR: Triggering client hub event 'addAlert' on hub 'AlertHub'.
Many of these events will come in for a short while, then just stop, even though the server should still be sending them.
I am using Firefox 35.0.1 on Mac and SignalR 2.0.0.
I realize that a work-around is to force a page refresh every 10 mins or so, but I'm looking for a way to fix the root cause of the problem.
I enabled SignalR tracing on the server. I created an "alert" on the server after a fresh refresh of the Alert page and the alert came through. I waited about 10 mins and I tried it again, and it failed to come through. Here's what the logs read (sorry for the verbosity, not sure what was relevant):
SignalR.Transports.TransportHeartBeat Verbose: 0 : KeepAlive(b8b21c4c-22b4-4686-9098-cb72c904d4c9) SignalR.Transports.TransportHeartBeat Information: 0 : Connection 0b1f6834-a5f0-4e4c-a9e8-de89f02df148 is New. SignalR.Transports.WebSocketTransport Information: 0 : CloseSocket(0b1f6834-a5f0-4e4c-a9e8-de89f02df148) SignalR.Transports.TransportHeartBeat Verbose: 0 : KeepAlive(b8b21c4c-22b4-4686-9098-cb72c904d4c9) SignalR.Transports.TransportHeartBeat Verbose: 0 : 0b1f6834-a5f0-4e4c-a9e8-de89f02df148 is dead SignalR.Transports.TransportHeartBeat Verbose: 0 : 0b1f6834-a5f0-4e4c-a9e8-de89f02df148 is dead SignalR.Transports.TransportHeartBeat Verbose: 0 : KeepAlive(b8b21c4c-22b4-4686-9098-cb72c904d4c9) SignalR.Transports.TransportHeartBeat Verbose: 0 : 0b1f6834-a5f0-4e4c-a9e8-de89f02df148 is dead SignalR.Transports.TransportHeartBeat Verbose: 0 : 0b1f6834-a5f0-4e4c-a9e8-de89f02df148 is dead SignalR.Transports.TransportHeartBeat Verbose: 0 : KeepAlive(b8b21c4c-22b4-4686-9098-cb72c904d4c9) SignalR.Transports.TransportHeartBeat Verbose: 0 : 0b1f6834-a5f0-4e4c-a9e8-de89f02df148 is dead SignalR.Transports.TransportHeartBeat Verbose: 0 : 0b1f6834-a5f0-4e4c-a9e8-de89f02df148 is dead SignalR.Transports.TransportHeartBeat Verbose: 0 : KeepAlive(b8b21c4c-22b4-4686-9098-cb72c904d4c9) SignalR.Transports.TransportHeartBeat Verbose: 0 : 0b1f6834-a5f0-4e4c-a9e8-de89f02df148 is dead SignalR.Transports.TransportHeartBeat Verbose: 0 : 0b1f6834-a5f0-4e4c-a9e8-de89f02df148 is dead SignalR.Transports.TransportHeartBeat Information: 0 : Removing connection 0b1f6834-a5f0-4e4c-a9e8-de89f02df148 SignalR.Transports.WebSocketTransport Information: 0 : Abort(0b1f6834-a5f0-4e4c-a9e8-de89f02df148) SignalR.Transports.WebSocketTransport Information: 0 : End(0b1f6834-a5f0-4e4c-a9e8-de89f02df148) SignalR.Transports.WebSocketTransport Verbose: 0 : Cancel(0b1f6834-a5f0-4e4c-a9e8-de89f02df148) SignalR.Transports.WebSocketTransport Verbose: 0 : DrainWrites(0b1f6834-a5f0-4e4c-a9e8-de89f02df148) SignalR.Transports.WebSocketTransport Information: 0 : CompleteRequest (0b1f6834-a5f0-4e4c-a9e8-de89f02df148) SignalR.Transports.TransportHeartBeat Verbose: 0 : KeepAlive(b8b21c4c-22b4-4686-9098-cb72c904d4c9) SignalR.Transports.TransportHeartBeat Verbose: 0 : KeepAlive(b8b21c4c-22b4-4686-9098-cb72c904d4c9) SignalR.Transports.TransportHeartBeat Verbose: 0 : KeepAlive(b8b21c4c-22b4-4686-9098-cb72c904d4c9) SignalR.Transports.TransportHeartBeat Verbose: 0 : KeepAlive(b8b21c4c-22b4-4686-9098-cb72c904d4c9) SignalR.Transports.TransportHeartBeat Verbose: 0 : KeepAlive(b8b21c4c-22b4-4686-9098-cb72c904d4c9) SignalR.Transports.TransportHeartBeat Verbose: 0 : KeepAlive(b8b21c4c-22b4-4686-9098-cb72c904d4c9) SignalR.Transports.TransportHeartBeat Verbose: 0 : KeepAlive(b8b21c4c-22b4-4686-9098-cb72c904d4c9)
Aucun commentaire:
Enregistrer un commentaire