|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1511 Huge delay/hang when reading sockets...
Submitted: 1999-06-08 16:19 UTC Modified: 1999-06-18 11:54 UTC
From: danbeck at scott dot net Assigned:
Status: Closed Package: Performance problem
PHP Version: 3.0.9 OS: Linux (RedHat 5.2)
Private report: No CVE-ID: None
 [1999-06-08 16:19 UTC] danbeck at scott dot net
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);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-18 11:54 UTC] sas at cvs dot php dot net
fixed in CVS
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Jun 14 07:01:23 2021 UTC