PHP socket communication entry 2: UDP protocol

Source: Internet
Author: User
In the previous article "entry 1: TCP protocol for PHP socket communication", we have roughly introduced the functions and features of the TCP protocol. The UDP protocol we will introduce in this article is the same as the TCP protocol. in the previous article "PHP socket-based communication entry 1: TCP protocol, we have roughly introduced the functions and features of the TCP protocol. The UDP protocol we will introduce in this article is the same as the TCP protocol. it also belongs to the host-to-host Layer Protocol (do not worry if you are not familiar with the host layer, this is just a concept and will not affect the general use of socket. If you are interested, you can find information about the DOD model ).
The UDP Protocol is short for User data Protocol. It is parallel to the TCP protocol and provides two different transmission services.
Briefly introduces the features of UDP. UDP is a non-connectivity and unreliable transmission protocol. Here, it is not reliable. it means that the correctness of the UDP protocol during data transmission is not as high as that of the TCP protocol. However, at the expense of data accuracy, the transmission efficiency of UDP protocol is higher than that of TCP protocol. Users can choose which protocol to use for data transmission based on their specific needs. For example, we can use UDP for email and TCP for remote desktop login.
In the last article, we mentioned that when using TCP to connect two hosts, it is not enough to use IP addresses. Similarly, UDP uses ports to connect two hosts.
Now, we have come to an end for the time being to study the theoretical preparations for socket communication. in the next article, we will officially begin to learn how to use PHP for socket communication.

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.