Stoping SignalR connection of Javascript client is slow (around 30 seconds).
I use SignalR, version 2.0.1 (but problem reproduced in 2.0.0 ) for webchat integrated to ASP.NET site. I have one .NET SignalR client(for other reason) and a lot of JS clients (chat clients). My test case is very simple. I want to disable chat on ASP.NET page. For this reason I try to stop SignalR connection using next code:
$.connection.hub.stop();
But onDisconnected method (on hub) was calling only after 30 seconds. I suppose that connection was stopped by disconnect timeout but not by Javascript code. I use LongPolling transpot by default.
var initObject = { transport: ["longPolling", "webSockets", "foreverFrame", "serverSentEvents"] };
$.connection.hub.start(initObject).done(function () {
...
}
Problem reproduce in last versions of Google Chrome but works fine in IE and Mozilla. What reason of so strange behaviour of SignalR and how can I avoid it?