but when the user closes the window, they remain connected, unless manualy disconnected by me (the server).
I have the server send a string every 10 seconds, and if the client doesnt send back then it disconnects them.....but it still stays connected. So the script is obviously still running, even with the window that the script was loaded on, was closed.
heres how the clients setup :
Code: Select all
do {
$data = socket_read($socket,8192,PHP_BINARY_READ);\
//switch this and case that
} while (true);
socket_shutdown($socket);
socket_close($socket);Suggestions on having them disconnect when they are no longer running the script?
thanks