SignalR/SignalR — Issue #227: impossible to get reconnect/ disconnect event catched on client js hub
Author: straeger
Created: 2012-03-07 12:48:33+00:00
State: open

Hello,
I have problems getting the disconnect or reconnect event catched in an clientside js hub.

I have a hub
var messageHub = $.connection.connectionHub;

and I've tried to get the events by bindiing to the reconnect or diconnect event.

messageHub.bind("onReconnect", function (e, data) {
alert('disconnected');
});

messageHub.bind("onDisconnect", function (e, data) {
alert('disconnected');
});

I have also tried to give a callback to signalR within:

messageHub.disconnected = function () { alert('disconnected 2'); };

The transport is set not set but signalR is using "serverSentEvents" in my environment.

But nothing gives me the expected result. Can anyone point me to an example or solution?

regards,
Stephan