How to detect improper WebSocket disconnection in FastAPI?
I’m building a FastAPI server that communicates with a Flet front-end via WebSocket. I need the server to detect if the client disconnects improperly (e.g., the app crashes or the network connection is lost).