If a PHP process is sharing a file-descriptor with another process/thread, the file-descriptor will be closed for every other process/thread using that descriptor -- when using stream_socket_shutdown and causes broken pipes. At least in Linux, this should not happen, instead, the OS maintains a list of listeners/writers and will only break the pipe once all listeners are gone. fclose respects this and doesn't forcibly close the pipe for all users of the pipe.
This is especially important when accepting sockets and handing them off to another process (think CGI) and then closing the PHP side.
If a PHP process is sharing a file-descriptor with another process/thread, the file-descriptor will be closed for every other process/thread using that descriptor -- when using
stream_socket_shutdown
and causes broken pipes. At least in Linux, this should not happen, instead, the OS maintains a list of listeners/writers and will only break the pipe once all listeners are gone.fclose
respects this and doesn't forcibly close the pipe for all users of the pipe.This is especially important when accepting sockets and handing them off to another process (think CGI) and then closing the PHP side.
closes #105