javascript - SignalR OnDisconnected Not Fired on Internet Connection Loss -
it understanding internet connection loss should fire signalr disconnect. using code snippet handle disconnect never gets fired on loss of internet connection. causes using signalr stop working. am missing here? waiting several minutes , disconnect set 30 seconds. need test internet connection loss separately? read in post shouldn't happen although quite old.
; var hubstartup = hubstartup || (function () { function start() { logdebuginfo('starting hub router.'); $.connection.hub.start().done(function () { logdebuginfo('connected hub router.'); // stuff }).fail(function () { logdebugerror('unable start hub router.'); }); } $.connection.hub.disconnected(function () { logdebuginfo('attempting reconnect hub router.'); settimeout(function () { $.connection.hub.start(); }, 5000); // restart connection after 5 seconds. }); return { start: start } })();
upgrade signalr 2.1.0+ solve issue.
Comments
Post a Comment