0
votes

I have a few questions related to SignalR as available in ASP.NET Core. Being relatively new to SignalR, I'm not quite confident regarding these questions:

  • According to this article group rejoining is possible in ASP.NET SignalR. Is the same behavior also available in SignalR shipped with ASP.NET Core?
  • Does Context.ConnectionId remain same if the client has to reconnect to SignalR hub (by reconnect here I mean just recovered from a non active connection and not changing to a new website)?

Configuration:

I'm using ASP.NET Core 3.1 and the SignalR server version 3.1.0 shipped with it. For the client side, I'm using 2 kinds of clients: .NET Core SignalR client version 3.0 and Javascript client 3.1.8.

1
Does Context.ConnectionId remain same if the client has to reconnect to SignalR hub In this doc, you can find: If the client successfully reconnects within its first four attempts, the HubConnection will transition back to the Connected state and fire its onreconnected callbacks. And since the connection looks entirely new to the server, a new connectionId will be provided to the onreconnected callback.Fei Han

1 Answers

3
votes

So I've been doing some research myself in the meantime and thought that this post might be helpful to some.

According to this article group rejoining is possible in ASP.NET SignalR. Is the same behavior also available in SignalR shipped with ASP.NET Core?

No, group membership is not preserved when you reconnect in ASP.NET Core SignalR. Check this link.

Does Context.ConnectionId remain same if the client has to reconnect to SignalR hub (by reconnect here I mean just recovered from a non-active connection and not changing to a new website)?

No since the connection looks entirely new to the SignalR server, a new connectionId is generated. This might be because a new negotiate call is instantiated by the client which consequently results in a new connectionId.