Bug #1511: Huge delay/hang when reading sockets...
| From: | danbeck at scott dot net | Date: | Tue, 08 Jun 1999 20:20:00 +0000 |
| Subject: | Bug #1511: Huge delay/hang when reading sockets... | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-6731@lists.php.net to get a copy of this message | ||
From: danbeck@scott.net
Operating system: Linux (RedHat 5.2)
PHP version: 3.0.9
PHP Bug Type: Performance problem
Bug description: Huge delay/hang when reading sockets...
The following code causes about a 10 to 15 second delay/hang before finishing. I'm not sure
why it takes so long to read from the socket, the server here on our LAN returns a reponse to the
initial fwrite() almost instantly... I have a perl script that uses similar code and it's
instantaneous.
$socket = fsockopen($h_addr, $h_port, &$errno, &$errstr);
$cmd = "arbitrary data";
fwrite($socket, $cmd, strlen($cmd));
while (!feof($socket)){
$buffer .= fread( $socket, 1024);
}
fclose ($socket);