PHP 4.0 Bug #2180: fgets() (and probely other socket functions) won't return in non_blocking mode
| From: | wico at cnh dot nl | Date: | Sat, 28 Aug 1999 13:40:36 +0000 |
| Subject: | PHP 4.0 Bug #2180: fgets() (and probely other socket functions) won't return in non_blocking mode | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-10292@lists.php.net to get a copy of this message | ||
From: wico@cnh.nl
Operating system: linux redhat 6.0
PHP version: 4.0 Latest CVS (28/08/1999)
PHP Bug Type: Misbehaving function
Bug description: fgets() (and probely other socket functions) won't return in non_blocking
mode
Same bug as in php 3.0.11 (is fixed in cvs 3.0.12-dev) (should have been fixed in beta2 witch
isn't :( )
test script:
<?
echo "plop<BR>\n"; flush();
$fp = fsockopen("irc.net.local", 4400);
if ($fp) {
set_socket_blocking($fp, 0);
fputs($fp,"PASS :wisky\nSERVER Wico.net.local 1 932044265 932044265 J10 A 0 :plop\n");
while (TRUE) {
$out = fgets($fp, 1000);
/* won't come here until socket closes or many many data is send */
flush();
if ($out) {
echo "boe: '$out'<BR>\n";
flush();
}
}
}
?>