New: Intelligent Flashcards spaced-repetition decks for every topic, built to make things actually stick.
Why does a WebSocket connection stay open through many messages instead of closing after each reply like a typical FastAPI route?
It repeats a fresh HTTP request every time new data needs to move, like polling.
The handshake opens one connection that stays alive, letting both sides send messages back and forth freely.
It works like a single request and response pair, so the connection always closes right after the first message either side sends.