Why php socket programming should be divided into server-side php socket and client-side php socket?

Why should php socket programming be divided into server-side php socket and client-side php socket? Isn"t php itself a server? I"m a little confused.

I studied the tutorials for this website: http://www.codeceo.com/articl.

.

God of trouble take a look, what does he mean by server, client php socket?

Mar.06,2021

  • first of all, you have to understand the meaning of context socket here: socket refers to http socket, which is built on tcp/ip/mac/ optical fiber cable (transport layer / network layer / link layer / entity layer). Socket, commonly known as socket, is end-to-end communication (client / server), not unilateral behavior. Tcp determines the port, ip+mac determines the host, host + port is the http socket here.


who says PHP is just something on the server side? Pull it out and play PP! The questions asked by the injured LZ are all wrong.


can connect to socket services on other machines, when the client connects


socket is a communication mechanism. One side of the link is the client and the other is the server

.

such as

stream_socket_server
is to create a server socket

corresponding to it, there must be a client connecting to the server

stream_socket_client

so in fact, it is not the initialization of PHP server or client socket, which is simply distinguished in PHP usage
by the way, PHPsocket has two types of functions that can be implemented, such as stream_socket_ series and socket_ series

.

suggest the landlord to read another article (https://codeshelper.com/a/11.).

the concept of the original text is not clear, and some things are too vague.
for example:
Socket is used for interprocess communication. -- Socket can be used for inter-process communication (which requires networking), but Socket is mainly inter-network communication.

Socket is essentially an encapsulated api, not a protocol, but an api between the application layer and the transport layer.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4bdfc-44e73.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4bdfc-44e73.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?