Okay, here is a short description of the function you have listed:
fsockopen opens a socket descriptor to the specified server and port using TCP over IP (unless you specify UDP). Once a connection has been made, the socket handle is stored in $fp (think of this as a file handle). You can now use fwrite and fread to write and read data from the socket just as you would do on a file handle.
BUT: the problems with sockets is that if a connection freeze occurs, your fread and fwrite will continue forever until the global script timeout is reached. For that reason you can set the polling timeout to timeout whenever the socket descriptor doesn't respond for a certain timeout interval. I think the command to set this timeout in PHP is: socket_set_timeout(). You can also refer to the manual to set a timeout on the initial socket connection. Refer the these man pages for more help:
http://www.php.net/manual/en/function.socket-set-timeout.php
http://www.php.net/manual/en/function.fsockopen.php
Also, unlike a file descriptor, when you perform a read of a socket descriptor, it usually waits for SOME data (even if there is NONE). So you can set blocking which allows fget or fread to terminate if no data is available. But this is sometimes buggy because if the socket responds after 1 or two seconds, and if you're in block mode, fget will terminate very quickly and will not return any data. For this reason do not set blocking on unless you know the protocol very well and you have a good connection between your server and the remote server.
here's the page for socket blocking:
http://www.php.net/manual/en/function.socket-set-blocking.php