Giter Club home page Giter Club logo

websocket's Introduction

Simple websocket client-server communication example

  • This program basically demonstrate the basic chat application

Basic information about websocket

  • WebSockets run on top of the TCP (Transmission Control Protocol) network protocol.

  • WebSockets provide a full-duplex communication channel over a single TCP connection, allowing for real-time data exchange between a client and a server.

  • Here's a brief overview of how WebSockets use the TCP protocol:

  • TCP is a reliable,connection-oriented protocol - mechanisms for establishing and maintaining a reliable connection between the sender and receiver.

  • WebSocket Protocol: WebSockets build on top of TCP to provide a standardized way for web browsers and servers

  • to establish a long-lived, bidirectional communication channel.

  • Unlike traditional HTTP, where the client initiates a request and the server responds,

  • ==>WebSockets allow both the client and server to send messages to each other at any time without the overhead of re-establishing connections.

  • Handshake: The WebSocket connection starts with an HTTP-based handshake, during which the client sends an upgrade request to the server,

  • requesting to switch from HTTP to the WebSocket protocol.

  • If the server supports WebSocket, it responds with a successful handshake, and the connection is upgraded to WebSocket.

  • Data Exchange: Once the WebSocket connection is established, both the client and server can send messages in either direction.

  • These messages can be in the form of text or binary data.

  • The messages are framed within the WebSocket protocol, which includes framing information to delineate individual messages.

  • Efficiency: WebSockets are more efficient for real-time communication compared to traditional HTTP polling

  • or long polling, as they eliminate the need for repeated connection establishment and HTTP headers in each message.

  • Overall, WebSockets leverage the reliability and established infrastructure of the TCP protocol

  • while providing an efficient and low-latency means of bidirectional communication over the web.

websocket's People

Contributors

vrushaliraut avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.