What is a socket??

Source: Internet
Author: User

Sockets originate from UNIX, and one of Unix/linux's basic philosophies is that "everything is a file" and can be manipulated with "opening open, read-write write/read-close" mode. My understanding is that the socket is an implementation of the pattern, the socket is a special kind of file, some of the socket function is the operation of it (read/write Io, open, close),

When we transmit data, we can only use the (Transport Layer) TCP/IP protocol, but then, if there is no application layer, it will not be able to identify the data content, if you want to make the transferred data meaningful, you must use the Application layer protocol, the application layer protocol, such as HTTP, FTP, Telnet, etc., also You can define the application layer protocol yourself, the Web uses the HTTP protocol to do the application layer protocol to encapsulate HTTP text information, and then use TCP/IP as the Transport layer protocol to send it to the network.

(1) socket is a TCCP and UDP programming interface, you can use it to establish a TCP connection, and so on, and TCP and UDP protocol protocol belongs to the Transport layer, and HTTP is an application layer protocol, it is actually built on the TCCP protocol. HTTP is a sedan that provides a specific form of encapsulation or display data, and the socket itself is the engine that provides the ability to communicate over the network.

(2) socket is the TCP/IP protocol encapsulation, the socket itself is not a protocol, but the call interface (API), through the socket, we can use the TCP/IP protocol abstraction, thus forming some of the most basic function interfaces we know.

What is a socket??

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.