I'm seeing some odd/unexpected behaviour using the SignalR 2.0.3 libraries.
I'm trying to hook some call backs in the client and they don't seem to be getting fired. I'd really like to get the reconnecting, reconnected and disconnected call backs working in JS - client side. SignalR does connect successfully and I've got communication between the server and client.
Here are a couple of code snippets:
$.connection.reconnecting = function () {
alert("reconnecting");
};
$.connection.reconnected = function () {
alert("We have been reconnected");
};
$.connection.disconnected = function () {
alert("We are disconnected!");
};
I could have sworn that I had these firing when I was using SignalR 1.x. Currently, we using version 2.0.3.
I'm running a 2 machine setup where my server app (and hub) is on 1 machine.
Here are the steps I'm using to reproduce:
1) Connect from a second machine. I looked at the network traffic in the browser console and it looks ok.
2) Next I disconnect the client machine from the network. In the console I see SignalR attempting to reconnect. (This is as expected)
3) Ultimately after N retries, it looks like it disconnects. (I see the final retry is "Canceled" in the console output.
4) However, my disconnected() handler does not get called.
Any insights or thoughts how to track this down?
Thanks, JohnB