I have a chat room using SignalR Hub for its messaging. Occasionally I get reports from users where it ‘freezes’. Now this can be interpreted as no messages are coming through, I suspect as they have been dropped from a group.
My question is, does the connection get re-subscribed back into its groups automatically, or do you have to do something yourself in the Reconnect method:
public Task Reconnect(IEnumerable<string> groups)
{
return Clients.rejoined(Context.ConnectionId, DateTime.Now.ToString());
}
Yes, in 1.0.0.0-alpha1 you can enable auto rejoining of groups by using the new
AutoRejoiningGroupsModulepipeline module using theEnableAutoRejoiningGroupsextension method for the hub pipeline you build. This feature was not available in previous versions of the framework.So you would end up with this somewhere in your startup code:
UPDATE:
Please note that the final version of SignalR 1.0 made auto-rejoining of groups the default behavior and so
EnableAutoRejoiningGroupswas removed. You can see this answer for more details.