thanks joe. for my application sockets turned out to be the best way to go.
i was running a few tests with php sockets a few months back, and everything seems to be ok if the server you are calling is linux. there seems to be a bug with php socket functions and windows though.
i ended up using a socket script for this one, but in an indirect way. the server i was reading the file from is a game server, and i have other scripts which connect and check game status. if the server doesn't respond, then i just don't try to read the file.
basically the same thing you are showing here.
another option is curl too:
http://www.php.net/manual/en/function.curl-setopt.php .. you must have the curl extention installed correctly though. it can be a pain, especially if you are developing or hosting on windows. if curl is installed and running correctly on the server, you can use the set_opt TIMEOUT to read a file. curl is great! i use it for sending and receiving xml securely with ups.