Mantis - Quercus
Viewing Issue Advanced Details
2120 minor always 10-26-07 22:18 10-29-07 15:05
koreth  
ferg  
normal  
closed 3.1.3  
fixed  
none    
none 3.1.4  
0002120: fwrite() on socket doesn't write data
Run "nc -l -p 12345" to listen for a connection on port 12345. Then:

<?php
$fp = fsockopen("localhost", 12345);
for ($i = 0; $i < 10; $i++) {
        fwrite($fp, $i . " ");
        sleep(1);
}
fwrite($fp, "\n");
fclose($fp);

On vanilla PHP, you will see the numbers 0-9 appear, one per second, in the nc output, then a newline. Quercus pauses for 10 seconds and you get no output from nc whatsoever -- the data never gets sent over the socket.

If you fflush() after each fwrite(), then you get the output. Likewise if you fread() (and send some data from the remote side).

Notes
(0002409)
ferg   
10-29-07 15:05   
php/4820