php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7542 socket_set_blocking is not working
Submitted: 2000-10-31 08:07 UTC Modified: 2005-09-02 07:28 UTC
From: a dot weerman at kub dot nl Assigned:
Status: Closed Package: *General Issues
PHP Version: 3.0 OS:
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: a dot weerman at kub dot nl
New email:
PHP Version: OS:

 

 [2000-10-31 08:07 UTC] a dot weerman at kub dot nl
$tek = "&";
$fp = fsockopen(.., .., &$errno, &$errstr, 15);
socket_set_blocking ($fp, 0);
if(!$fp):
  //error
else:
  fputs($fp,"GET / HTTP/1.0\n\n");
  $counter = 0;
  while ( list( $key, $val ) = each( $HTTP_POST_VARS ) ) {
    if ($counter < count($HTTP_POST_VARS)-1):
      fputs($fp, $key . "=" . $val . $tek);
    else:
      fputs($fp, $key . "=" . $val);
    endif;
    $counter += 1;
  }
  $running = false;
  $stop = time() + 15;
  while(!feof($fp)&& time()<$stop) {
      echo fgets($fp,128);
      $running = true;
  }
  fclose($fp);
  if (!$running):
    // error
  endif;
endif;

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-31 08:17 UTC] a dot weerman at kub dot nl
above code worked with PHP Version 4.0.0 but not after upgrade to 4.03pl1..


 [2005-09-02 07:28 UTC] sniper@php.net
works fine nowadays. (just clearing out old reports)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 01 01:01:28 2024 UTC