In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
What does websocket mean? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
WebSocket is a protocol for full-duplex communication over a single TCP connection. The WebSocket communication protocol was defined as the standard RFC 6455 by IETF in 2011 and supplemented by RFC7936. WebSocket API is also defined as a standard by the W3C.
WebSocket makes it easier to exchange data between the client and the server, allowing the server to actively push data to the client. In WebSocket API, only one handshake is needed between the browser and the server, and a persistent connection can be directly created between the browser and the server for two-way data transmission.
Advantages
Less control overhead. After the connection is created, the packet header used for protocol control is relatively small when data is exchanged between the server and the client. Without an extension, the header size is only 2 to 10 bytes for server-to-client content (depending on packet length), and an additional 4-byte mask is required for client-to-server content. This overhead is significantly reduced compared to having to carry a complete header every time a HTTP request is made.
Stronger real-time performance. Because the protocol is full-duplex, the server can actively send data to the client at any time. Compared with the HTTP request, it needs to wait for the client to initiate the request before the server can respond, and the delay is significantly less; even compared with similar long polling such as Comet, it can transmit data more times in a short time.
Stay connected. Unlike HTTP, Websocket needs to create a connection first, which makes it a stateful protocol, and then some state information can be omitted when communicating. HTTP requests may need to carry status information (such as authentication, etc.) in each request.
Better binary support. Websocket defines binary frames, which make it easier to handle binary content than HTTP.
Extensions can be supported. Websocket defines extensions that allow users to extend protocols and implement partially customized subprotocols. Such as some browsers support compression and so on.
Better compression effect. Compared to HTTP compression, Websocket can use the context of previous content with appropriate extension support, and can significantly increase the compression ratio when passing similar data.
Handshake protocol
WebSocket is a stand-alone protocol created on TCP.
Websocket shakes hands through the 101status code of the HTTP/1.1 protocol.
To create a Websocket connection, you need to make a request through a browser and then the server responds, a process often referred to as a "handshaking".
The answer to the question about what websocket means is shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.