Bird
0
0

Why might WebSockets be preferred over Server-Sent Events (SSE) in a Flask app requiring bidirectional communication?

hard📝 Conceptual Q10 of 15
Flask - WebSocket and Real-Time
Why might WebSockets be preferred over Server-Sent Events (SSE) in a Flask app requiring bidirectional communication?
AWebSockets support full-duplex communication, SSE is unidirectional
BSSE supports binary data, WebSockets do not
CWebSockets are simpler to implement than SSE
DSSE works on all browsers, WebSockets do not
Step-by-Step Solution
Solution:
  1. Step 1: Compare communication directions

    WebSockets allow two-way (full-duplex) communication; SSE only sends data from server to client.
  2. Step 2: Evaluate other options

    SSE does not support binary data well; WebSockets do. WebSockets are more complex to implement. Both have good browser support.
  3. Final Answer:

    WebSockets support full-duplex; SSE is unidirectional -> Option A
  4. Quick Check:

    Bidirectional = WebSockets [OK]
Quick Trick: Use WebSockets for two-way communication, SSE is one-way only [OK]
Common Mistakes:
MISTAKES
  • Thinking SSE supports two-way
  • Confusing binary support
  • Assuming WebSockets lack browser support

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Flask Quizzes