Web development and sockets

Source: Internet
Author: User
I've learned PHP, I've done a website like online shopping.

Recently, looking at the protocol, touching the socket TCP/IP protocol and things like that.


If I'm not mistaken, the socket is like an API function package that allows TCP and UDP protocols to be implemented with this package
So my question is: when we use PHP to make a Web site, such as when it comes to server and client interaction information, what protocol is implemented? Is it a top-level protocol like the HTTP protocol? Is there no direct relationship between this and the TCP protocol??


Thank you ~


Reply to discussion (solution)

Yes, there is no direct relationship to the TCP protocol
TCP/IP is the underlying communication protocol
The socket is a TCP/IP wrapper
HTTP build and socket

The browser is based on the HTTP protocol, and TCP/IP is also related.
Specifically, you can see the differences between HTTP protocols and TCP/IP.

is essentially a TCP/IP transport protocol. Based on this, a certain format is specified for the transmitted data, for example, which part is the head, which part is data and so on, which forms the HTTP protocol.
This is like using a socket to transfer a JSON-formatted string, then how to extract valid data from the string after receiving it, one reason.
That's how I understand it.

  • 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.