Re: Bug #1511: Huge delay/hang when reading sockets...

From: Date: Tue, 08 Jun 1999 21:23:16 +0000
Subject: Re: Bug #1511: Huge delay/hang when reading sockets...
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-6732@lists.php.net to get a copy of this message
On Tue, Jun 08, 1999 at 08:20:00PM -0000, danbeck@scott.net wrote: > 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. > > Try adding a set_socket_blocking($socket, true); and tell us, if it helps. > $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); > > > > > -- > PHP Development Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > -- Regards, Sascha Schumann Consultant

« previous php.dev (#6732) next »