Q32: What are WebSockets and when should they be used over HTTP polling?
WebSockets provide persistent, full-duplex TCP connections for real-time bidirectional communication. Use them for real-time features like chat applications or live data feeds.
Key Takeaways
- Full-duplex real-time communication over single TCP connections.
- Eliminates overhead associated with HTTP header polling requests.
Knowledge Check
Which protocol upgrade header converts an HTTP connection into a WebSocket?