[PHP-DEV] PHP 4.0 Bug #7542: socket_set_blocking is not working From: a.weerman <email protected>
Date: 10/31/00

From: a.weerman <email protected>
Operating system: win32
PHP version: 4.0.3pl1
PHP Bug Type: *General Issues
Bug description: socket_set_blocking is not working

$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;

-- 
Edit Bug report at: http://bugs.php.net/?id=7542&edit=1

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>