Incredibly simple real-time web for .NET
In 2.1.0 we added an overload of OnDisconnect on PersistentConnection and Hub that takes a boolean indicating whether the disconnect from the client was due to a timeout or not. In making this change we also changed when the existing overload (without the parameter) was called. These changes together resulted in applications not always being called when a client disconnects in a way they were used to expecting. We're resolving this in 2.1.1 by removing the original overload (the parameterless one). OnDisconnect will now always be called when a client disconnects and the flag passed indicates whether it was due to a timeout or not.
We've changed what happens when a connection is detected as "gone" on the server. In the past, we made efforts to ensure the server-side disconnect events were raised only once, even if a logical connection had actually been alive on more than one server during its life (in the case of a web farm). This involved sending messages between web nodes in the farm which could lead to undue strain on the backplane, especially when the long polling transport was in use (see #2958).
From this version on, the event will always be raised on any server that has seen a connection and then detects it has gone. We've added a new overload (#2998) so that you can handle the cases when the connection stops due to timeout (like if it moves to another server, or loses network connectivity) or due to the stop method being called on the client (aka a graceful close, e.g. when the user closes the browser).
Be sure to factor this change of behavior into your application design.
IHubConnectionContext
changed to IHubConnectionContext<T>
To support the new strongly typed client Hubs (#2449) the interfaces IHubConnectionContext
and IHubCallerConnectionContext
had to be made generic. To continue using these types with a dynamic client method contract, as in previous versions, just specify the generic type argument as dynamic
, e.g.
IHubConnectionContext<dynamic> context = GlobalHost.ConnectionManager.GetHubContext<MyHub>();
Fix for MS13-103
Fix for MS13-103