php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: danbeck at scott dot net
New email:
PHP Version: OS:

 

 [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);


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-18 11:54 UTC] sas at cvs dot php dot net
fixed in CVS
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jan 05 09:01:27 2025 UTC