WebSocket Introduction (i)

Source: Internet
Author: User

WebSocket initiates a single request, the server does not need to wait for the customer service side, the client at any time can also send messages to the service side, reduce the polling time delay. After a connection has been made, it can be sent multiple times to the client. Is the difference between polling and WebSocket.

HTTP-based real-time messages are quite complex, maintaining a state of call in a stateless request adds complexity, and cross-domain is cumbersome, and using AJAX to process request-ordered requests requires more consideration. It's not easy to communicate via Ajax. The purpose of each extension of the HTTP feature is not to increase his complexity. WebSocket can greatly simplify the links in real-time communication applications. WebSocket is about the standard websocket is an underlying network protocol that allows you to build other standard protocols on this basis. For example, use XMPP to log on to different chat servers based on the WebSocket client, because all XMPP services understand the same standard protocol. WebSocket is an innovation in Web applications. To compete with other platforms, WebSocket is part of the advanced features offered by H5 applications. Each operating system requires network capabilities, enabling applications to communicate with other hosts using sockets, which is the core function of each large platform. In many ways, making Web applications behave like operating system platforms is a HTML5 trend. The underlying network protocol APIs such as sockets do not conform to the original security model and do not have the same design style as the Web API.     WebSocket provides TCP for H5 applications without weakening the network security and has a modern API. WebSocket is an important component of the HTML5 platform and a powerful tool for developers. Simply put, you need to websocket create a world-class web App. It makes up for a major flaw in HTTP that is not suitable for real-time communication. Asynchronous, bidirectional communication mode, with the Transport Layer protocol makes the WebSocket universal flexibility. Imagine all the ways you can create real-time apps with WebSocket. such as chat, collaborative document editing, massively multiplayer online games (MMO), stock trading applications, and more. WebSocket is a protocol, but there is also a websocket API, which allows your application to control the WebSocket protocol to respond to events triggered by the server. API is the development of the Iete, the agreement is formulated. Modern browsers support the WebSocket API, which includes methods and features that use full-duplex and bidirectional linking. Lets you perform such necessary actions as turning off links, sending incoming messages, and listening for server-side events. Chapter IIwill give more details and usage examples of these APIs. The WebSocket protocol enables the client and remote server to establish full-duplex communication over the Web. Supports the transfer of binary strings and text strings, and the protocol contains the basic message framework after the handshake is opened. Chapter IIIWill describe the details of more protocols and show you how to create your own WebSocket server. A large number of optional WebSocket servers, developer communities, and countless applications that are using websocket reflect the fiery websocket, with a large number of WebSocket servers already implemented, such as Apache Mod_pywebsocket, Jetty, Socket.io and Kaazing ' s WebSocket Gateway. This book is inspired by the sharing of our knowledge and experience in dealing with WebSocket and related technologies in the Kaazing project for many years. Kaazing has been used as an enterprise-class WebSocket gateway server and its client library for more than 5 years. Community: http://www.websocket.org/http://webplatform.org

"The Definitive Guide to HTML5 WebSocket" translation.

Ext.: http://www.cnblogs.com/stoneniqiu/p/5357444.html

WebSocket Introduction (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.