I was wondering if signalr changes the connectionId on OnReconnected method? as I'm mapping a list of users to their connection ids so if the reconneced event raised on the server due to slow connection for example will the connectionId will be changed ?
No. The connectionId does not change in an OnReconnected event.
So if you are mapping connectionIDs with Users then you need to make sure that the connection Id is updated with the new connectionId in every OnConnected event and deleted in every OnDisconnected event on the server .
I don't believe the OnReconnect will change the connectionID. However, that depends on what the cause of the problem is.
If the client dropped it's internet connection for example and then picked back up, OnReconnect fires and the user should have the same connectionID.
If the server rebooted or IIS restarted, then you have a different situation and when your clients refresh it will appear as a OnConnect and get a new connectionID.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With