Hi--
I have two questions regarding sockets that I havent been able to find an answer to on the internet.
The first is that when Im transferring a file I get an error when the other side quits. This error makes the script fail. What should I do so that when the other side stops downloading the script closes the connection and keep on looping (listening). (error: socket_write() unable to write to socket 4 [32]: Broken pipe in...)
The other is about cpu usage.
$bufsize = 20000;
while($buf = fread($fh, $bufsize))
socket_write($spawn, $buf);
fclose($fh);
The files that will be transferred are around 175mb. Is the buffer size at a good value?
Thanks-