SignalR how to reconnect with same connectionId #54818
Unanswered
quytrieu37
asked this question in
Q&A
Replies: 2 comments 17 replies
-
As a workaround you should be able to use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone, my question is related to signalR.
I have a long-running task on Hub and after it is complete, the hub will send a response base on Clients.Caller.SendAsync method
But currently, while running, it look like that hub doesn't send keep-alive message to client and after ServerTimeout (default is 30s), the connection will timeout and reconnect cause I config WithAutomaticReconnect() on client.
But when after reconnecting, the connection comes with difference connectionId so it can't listen to messages from server which send to old connectionId
I understand that there are Groups and Users to handle this scenario, but perhaps there is an alternative approach to retaining the connection ID after reconnecting?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions