php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6038 fread() in non blocking mode cant't read more than 901120 bytes
Submitted: 2000-08-09 01:24 UTC Modified: 2000-09-03 19:44 UTC
From: php-bugs at bjoernsworld dot de Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0.1pl2 OS: Winnt 4.0 SP 4
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: php-bugs at bjoernsworld dot de
New email:
PHP Version: OS:

 

 [2000-08-09 01:24 UTC] php-bugs at bjoernsworld dot de
socket_set_blocking($sock, false);
$data = fread($sock, 13453592);
print strlen($data);

The stream is exactly 13453592 bytes long and can "easily" be read in blocking mode.

"easily" means that fread() takes about 4 _minutes_ to read the data where e.g. telnet or other tools needs 4 _seconds_.

The stream is a HTTP connection.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-14 11:35 UTC] stas@php.net
Well, I didn't exactly see what's the problem here. It works OK for me in blocking mode.
In non-blocking, you are basically saying "give me anything from there but no more than X bytes", not "give me X bytes", so it does. So please xplain more in detail what's the problem.
 [2000-09-03 19:44 UTC] sniper@php.net
No feedback. Closed.

--Jani
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 05:01:33 2025 UTC