Replies: 1 comment 1 reply
-
@Kludex Hey, So I'm confused, the corresponding discussion post was left totally unanswered, and yet you move this issue back to discussions. I mean... I'm worried this will be left in "discussions" untouched for an indefinite amount of time. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How can the server detect a situation when the client didn't receive a message sent by the server,
specifically when the client disconnected not gracefully (=without letting the server know when closing the connection)?
To my understanding, this should have raised an exception, but it doesn't.
The first time when Starlette notices that anything is wrong, is when the ping interval times out.
To easily see that, run the following server:
and run it with a higher ping interval:
import uvicorn uvicorn.run('app:app',host='0.0.0.0', port=5000,ws_ping_interval=300, ws_ping_timeout=300)
For the client, use a mobile phone(it's probably true for web as well, but I verified that behavior on a mobile phone ), and put the phone in airplane mode while it is connected to the server.
Call the server via the endpoint /websockets/send_message/<user_id>.
The server will happily describe all of the messages as "sent" for 5 minutes.
If this behavior is expected (to my understanding exception should have been raised), how can I check if the message was actually received by the client?
Beta Was this translation helpful? Give feedback.
All reactions