How to get the fd of the server from the client after the php socket client connects to the server

I used swoole to build a server
php socket as a client. When the client connects to the server, the server has a unique number $fd,. Can you know how much this $fd is in the client?

Jan.20,2022

since it is all Socket, you can return it to the client


fd ( file descriptor ), file descriptor. When creating a socket connection, both the client and the server will generate a file for the connection (the connection is also represented as a file in linux ). The file description service is to find this file. The client and the server are generally not in the same file. Therefore, the client does not know what the file descriptor of the server socket connection is. Even if the server passes this file descriptor to the client in the form of data, it is meaningless

.
Menu