Bug #1739: fread() hangs while trying to read from a socket

From: Date: Mon, 19 Jul 1999 20:20:28 +0000
Subject: Bug #1739: fread() hangs while trying to read from a socket
Groups: php.dev 
Request: Send a blank email to php-dev+get-8737@lists.php.net to get a copy of this message
From: danbeck@scott.net Operating system: Linux 2.0.32 (RedHat 5.2) PHP version: 3.0 Latest CVS (19/07/1999) PHP Bug Type: Misbehaving function Bug description: fread() hangs while trying to read from a socket This problem has existed since about 3.0.9. It's supposedly been fixed in one way or another, but it keeps cropping up... consistantly. What I'm doing is attempting to read data from a socket using the following methodology: while (!feof($this->socket)){ $buffer .= fread( $this->socket, 1); } What happens is that php hangs for exactly 16 seconds every single time. Even if I just do a: $buffer = fread( $this->socket, 1024); it also hangs for the same amount of time. But... if I try to read a number of bytes less than or equal to the number of bytes available, it returns instantly with the data from the socket: $buffer = fread( $this->socket, 2);

« previous php.dev (#8737) next »