Hiya, just wondering if anyone has come accross this...
fsockopen seems to be bugged in at least 4.3.2 (done a lot of googling) and I don't have the capability to update to a later version.
There doesn't seem to be any way around getting fsockopen to work with a proper timeout either via its own timeout or stream/socket_set_timeout (afaik thats more for the data anyway, so wouldn't have any effect).
So basically unless someone has any new ideas on getting fsockopen to work with a timeout, I'm trying to look at alternatives to save a a page hanging for a long time when doing a server status query I've written.
One thought was putting the function in a separate php file, system execing it and putting a script timeout on it of a couple of seconds (thats all thats needed to know if this socket will open). Would this work as an alternative and someone feedback the error message if it fails? (If so wondering how to check for the right error as so far can't seem to retrieve anything properly, trying a system php script.php atm).
Feels a bit wrong somehow taking the approach of having a script fail and take the result from it, but really at a loose end otherwise (and sometimes it seems to hang with a high cpu load for a few seconds).
Any help much appreciated on if there is any better workaround than a script timeout, or if thats the only possiblity (or might not even be possible) whats the best method to check for a timeout on a script from within another script?