Skip to main content

Posts

Showing posts from November, 2023

Client-Server Communication Model (Part-3) - WebSockets

This is the third and final part of the Client-Server Communication Model. You can have a look at the first and second parts where we discussed different ways in which client and server can communicate. Here, we will focus on one of the most popular communication models: WebSockets. 5. WebSockets WebSockets ( RFC-6455 ) enable real-time, two-way, full-duplex communication between client and server over a single, long-lived connection. WebSocket, like SSE , provides a persistent connection. But in contrast to SSE, it enables full-duplex communication, which means that both client and server can communicate over the same channel. WebSockets are suitable for building interactive and dynamic applications that require continuous communication between clients and servers. It leverages the HTTP protocol for connection establishment. Since HTTP/1.0 is a non-persistent connection, WebSocket can not be implemented on HTTP/1.0. It needs a protocol having a persistent connection, like HTTP/...