search
HomeCommon ProblemWhat are the characteristics of websocket?

What are the characteristics of websocket?

Jun 24, 2020 am 11:17 AM
websocket

What are the characteristics of websocket?

Features:

  • Less control overhead. When data is exchanged between the server and client after a connection is created, the packet headers used for protocol control are relatively small. Without extensions, for server-to-client content, the header size is only 2 to 10 bytes (related to the packet length); for client-to-server content, additional headers need to be added. 4-byte mask. Compared with HTTP requests that carry complete headers every time, this overhead is significantly reduced.

  • Stronger real-time performance. Since the protocol is full-duplex, the server can proactively send data to the client at any time. Compared with HTTP requests, which need to wait for the client to initiate a request before the server can respond, the delay is significantly less; even compared with similar long polling methods such as Comet, it can deliver data more times in a short period of time.

  • Stay connected. Unlike HTTP, Websocket needs to create a connection first, which makes it a stateful protocol, and some state information can be omitted during subsequent communications. HTTP requests may need to carry status information (such as identity authentication, etc.) in each request.

  • Better binary support. Websocket defines binary frames, which can handle binary content more easily than HTTP.

  • can support extensions. Websocket defines extensions, and users can extend the protocol and implement some customized sub-protocols. For example, some browsers support compression, etc.

  • Better compression effect. Compared with HTTP compression, Websocket, with appropriate extension support, can inherit the context of previous content and significantly improve the compression rate when transmitting similar data.

The above is the detailed content of What are the characteristics of websocket?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools