Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 1.3 KB

README.md

File metadata and controls

24 lines (18 loc) · 1.3 KB

Real-time chat app

Websockets

  • WebSocket is a protocol

  • it is providing full-duplex communication channels over a single TCP connection. Where as, HTTP providing half-duplex communication.

    • TCP / IP : Transmission Control Protocol/Internet Protocol

      • a communications protocol for computer networks, the main protocol for the internet. (Transport layer)
    • full-duplex : describes simultaneous data transmission and receptions over one channel.

    • Half-duplex devices can only transmit in one direction at one time. Data can move in two directions, but not at the same time.

  • The WebSocket API is an advanced technology that makes it possible to open a two-way interactive communication session between the user's browser and a server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply.

  • WebSockets are useful when the server needs to push some real time information to the client about some events that happened on the server. This avoids the client making multiple polling HTTP requests to verify if some event has occurred on the server.