IF $sock is a closed socket and I do this.
$test = fread($sock, 1024); if($test == false) echo "Socket is closed;
This does not work though, although it does display an error saying the socket was closed by the software in the host machine. 😕
check the fopen return value
Sorry, I meant detecting if the socket was closed by the server after the two computers where connected!.
Does [man]feof[/man] return true immediately if the server closed the socket? Or will it wait for the socket timeout?