-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection to WebSocket disconnects no matter the timeout increases. (Azure SignalR) #246
Comments
Yes,
We do not want our signalR to be disconnecting that often because some of
our clients have slower internet connection which is the reason why we
raised the timeouts of the Hub.
We raised Keep Alive to 50 seconds and the connection time out to 150
seconds. Yet, our hub gets disconnected in just 10-15 seconds when their
internet fail, sometimes causing them to trigger the action over and over
because it is not responsive with the hub server.
I could replicate the issue by reproducing the steps I mentioned.
1. Clone and run any of the samples in this source code (I ran ChatRoom)
2. Entered the chat and send a first message
3. Then disconnect the internet (Turn off wifi, disconnect cable, etc)
and rapidly send another message.
4. Wait at least 10 seconds (It is supposed to stay connected waiting
for the message back from the server due to the longer timeout setting)
5. Turn internet back on
6. Websocket Close with error.
Why does it keep disconnecting so fast instead of listening to the timeouts
we set up? This happens in both ASP.NET Core and ASP.NET Framework.
…On Thu, Nov 16, 2023 at 10:05 PM Liangying.Wei ***@***.***> wrote:
Could you share more about your expected behavior?
IMHO, the behavior described works as expected:
1. When a message is sent when offline, WebSocket is closed, which
means the underlying transport for signalr connection is closed, so signalr
connection is closed. The messages sent to this connection is lost.
2. When internet comes back, since the signalr connection is closed,
it needs to reconnect.
—
Reply to this email directly, view it on GitHub
<#246 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASWDVRQLHM3CCI63YDPKYJDYE3H6JAVCNFSM6AAAAAA7O6GHKCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJVGY3TMNZXGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
The interesting thing however is that if the internet connection is lost
for less than 10 seconds, it waits for the messages to come back from the
server properly without any issues.
…On Thu, Nov 16, 2023 at 10:35 PM Charles Soto ***@***.***> wrote:
Yes,
We do not want our signalR to be disconnecting that often because some of
our clients have slower internet connection which is the reason why we
raised the timeouts of the Hub.
We raised Keep Alive to 50 seconds and the connection time out to 150
seconds. Yet, our hub gets disconnected in just 10-15 seconds when their
internet fail, sometimes causing them to trigger the action over and over
because it is not responsive with the hub server.
I could replicate the issue by reproducing the steps I mentioned.
1. Clone and run any of the samples in this source code (I ran
ChatRoom)
2. Entered the chat and send a first message
3. Then disconnect the internet (Turn off wifi, disconnect cable, etc)
and rapidly send another message.
4. Wait at least 10 seconds (It is supposed to stay connected waiting
for the message back from the server due to the longer timeout setting)
5. Turn internet back on
6. Websocket Close with error.
Why does it keep disconnecting so fast instead of listening to the
timeouts we set up? This happens in both ASP.NET Core and ASP.NET
Framework.
On Thu, Nov 16, 2023 at 10:05 PM Liangying.Wei ***@***.***>
wrote:
> Could you share more about your expected behavior?
>
> IMHO, the behavior described works as expected:
>
> 1. When a message is sent when offline, WebSocket is closed, which
> means the underlying transport for signalr connection is closed, so signalr
> connection is closed. The messages sent to this connection is lost.
> 2. When internet comes back, since the signalr connection is closed,
> it needs to reconnect.
>
> —
> Reply to this email directly, view it on GitHub
> <#246 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ASWDVRQLHM3CCI63YDPKYJDYE3H6JAVCNFSM6AAAAAA7O6GHKCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJVGY3TMNZXGA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For both ASP.NET and ASP.NET Core SignalR, when connecting to an Azure SignalR service. If by any reason, the user loses connection to internet, and then sends a message while being offline, the Websocket will close returning a 1006 Close code. By the time the internet comes back (Approximately 7-15 seconds), the message is lost, and the user needs to re click the action in order to send the message again after the hub is reconnected.
I have tried to increate all time outs mentioned here:
https://learn.microsoft.com/en-us/aspnet/signalr/overview/guide-to-the-api/handling-connection-lifetime-events
and
https://learn.microsoft.com/en-us/aspnet/core/signalr/configuration?view=aspnetcore-8.0&tabs=dotnet
How to replicate this issue:
The text was updated successfully, but these errors were encountered: