I have a home PHP TCP chat server, but it has no way to detect remote disconnects.
I would appreciate it if someone knew how easy it is to take stream_socket_server () and spit out everything related to it.
Then you can run such a loop in psuedocode:
$main_socket=stream_socket_server("tcp://",....) //Do Something.... say, wait for a connection (with stream_socket_accept())? for (each CONNECTION in $main_socket) { //Do something with or to that connection } //Loop back... if you need to say, wait for another connection
Alternatively , I can check if the variable created using $ stream_socket_accept () is connected.
This project is destroyed until I find out. I would be grateful to everyone who could help me with this!
source share