aspnet / SignalR-samples

Samples for ASP.NET Core SignalR
753 stars 398 forks source link

Server side: OnDisconnectedAsync call occurs at different intervals when Wi-Fi is turned off. #87

Open kapitaneo opened 5 years ago

kapitaneo commented 5 years ago

Hello to all. Please help solve problem. I've issue with calling OnDisconnectedAsync method when IPad wi-fi turned off, calling may be happen fast but some times it takes a long time more 10 minutes, but some times never. I need a stable disconnect calling for example 30 seconds. I use signalR 1.1.0 with default KeepAliveInterval and ServerTimeout. How I can manage this? I hope I don't have to do a manual check of the client to disconnect. It'll be terrible:(

Thx for help.

BrennanConroy commented 5 years ago

Are you using SignalR 1.1.0 on both the client and server side?

kapitaneo commented 5 years ago

Yes, you're right, but if I understand right problem in server side because when wi-fi off client doesn't have opportunity send response without internet connection. Or I've wrong thoughts about it?

BrennanConroy commented 5 years ago

In 1.1.0 we added client-side pinging so that the server can call OnDisconnectedAsync within the configured timeout (30 seconds by default). That's why I was wondering about the version of the client, because if you're using 1.0.0 then the client wont initiate the pings and the server wont start the timer to timeout the connection.

kapitaneo commented 5 years ago

In client use "@aspnet/signalr": "^1.1.4" Are there may be differences?

BrennanConroy commented 5 years ago

Could you gather server and client side logs as detailed here: https://docs.microsoft.com/en-us/aspnet/core/signalr/diagnostics?view=aspnetcore-2.2