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

Add a Patch

Pull Requests

Add a Pull Request

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 Apr 19 19:01:28 2024 UTC