Socket, WebSocket the relationship and difference between Ajax

Source: Internet
Author: User

Recently participated in a LAN chat project. Use of the WebSocket. Here is a brief introduction.

Sockets and WebSocket

Simply saying that the relationship between sockets and WebSocket is the same as Java and JavaScript. Never mind.

The Socket is a programming interface for transmitting data between the transport layer and the application layer in the TCP/IP protocol.
WebSocket is a method based on asynchronous communication between the browser and the server in HMTL5.

WebSocket and Ajax

Ajax is a technique that uses JS and XML to realize local refresh of Web pages, and can only request services from clients in one direction. When the page is displayed in real time, it can only be polled and requested every 0.5 seconds.
Server.
WebSocket is HTML5 a new protocol. The two-way communication between client and server is realized.
Applicable scenarios can be social subscription, collaborative editing, click Data, real-time update live, multimedia chat. Online education, real-time push.

Socket, WebSocket the relationship and difference between Ajax

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.