Individual features, differences, and scenarios for socket requests and HTTP requests

Source: Internet
Author: User
the socket implements a physical connection between the server and the client and transmits data. There are mainly tcp/udp of two protocols. The socket is in the transport layer of the network protocol. TCP: Transmission Control Protocol, connection-oriented protocols, stable and reliable. Before the customer and the server Exchange data with each other, a TCP connection must be established between the two parties before the data can be transferred.
UDP: Broadcast data transmission, UDP does not provide reliability, it simply sends the application to the IP layer of the datagram sent out, but does not guarantee that they can reach the destination. Because UDP does not have to establish a connection between the client and the server before transmitting the datagram, and there is no mechanism such as time-out retransmission, the transmission speed is very fast. Advantages: 1. Transfer data is byte-level, transfer data can be customized, the amount of data is small. Corresponding mobile development, mobile phone costs 2 lower. Transfer data time is short, high performance 3. Suitable for real-time interaction between C/S information 4. Can be encrypted, data security is high disadvantage: 1. The data that is transmitted must be parsed and translated into application-level data 2. The developer level requires 3. TTP protocol transmission, increased amount of development HTTP requests mainly have HTTP protocol, HTTP protocol-based SOAP protocol, common HTTP data request method has get and Post,web service advantages: 1. Application-level-based interface easy to use 2. The requirements of the development level is not high, fault-tolerant strong disadvantage:    1. The transmission speed is slow, the packet is large. 2. If real-time interaction is achieved, the server performance pressure is 3. Poor data transfer security

Individual features, differences, and scenarios for socket requests and HTTP requests

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.