php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17887 unable to read complete data stream with set_socket_blocked($fp,0)
Submitted: 2002-06-20 17:55 UTC Modified: 2002-07-01 16:05 UTC
From: sdsdgdds at yahoo dot de Assigned:
Status: Not a bug Package: Sockets related
PHP Version: 4.2.1 OS: Win XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sdsdgdds at yahoo dot de
New email:
PHP Version: OS:

 

 [2002-06-20 17:55 UTC] sdsdgdds at yahoo dot de
First of all I have to make a sleep() before I read data. Otherwise I don't receive any. It doesn't matter how long I sleep I allways get the same amount of data.

$ns = fsockopen("anyuri",80,$a,$a,$max);
$out="";
socket_set_blocking($ns,0);
fputs($ns,"GET / HTTP/1.1\r\nHost: anyuri\r\nConnection: close\r\n\r\n");
sleep(1);
while(!feof($ns)) $out.=strtolower(fread($ns,128));	

and how do I get the rest?

I tried to make another sleep and fread but there comes nothing. Even if I made socket_set_blocking($ns,1); and tried to read the rest I received nothing.

Everything works fine if I don't use socket_set_blocking($ns,0);

I tried it on some big sites and the maximum was about 25000 bytes!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-01 16:05 UTC] jason@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

feof() returns true on an error, and EWOULDBLOCK is considerd an error


 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Jan 26 05:01:24 2020 UTC