When implementing real-time data updates in a UI, what is the primary advantage of using WebSocket over HTTP polling?
WebSocket provides significant advantages over HTTP polling for real-time updates: 1) Maintains a persistent connection, reducing overhead of repeated HTTP requests, 2) Enables true bidirectional communication where both client and server can initiate messages, 3) Lower latency as there's no need to establish new connections, 4) More efficient use of server resources as it eliminates the need for constant polling. This makes WebSocket ideal for applications requiring real-time features like chat, live updates, or gaming.