<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.curl.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.curl-multi-select.php',
    1 => 'curl_multi_select',
    2 => '等待，直到任何 cURL 多句柄连接可以进行读取或写入',
  ),
  'up' => 
  array (
    0 => 'ref.curl.php',
    1 => 'cURL 函数',
  ),
  'prev' => 
  array (
    0 => 'function.curl-multi-remove-handle.php',
    1 => 'curl_multi_remove_handle',
  ),
  'next' => 
  array (
    0 => 'function.curl-multi-setopt.php',
    1 => 'curl_multi_setopt',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/curl/functions/curl-multi-select.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.curl-multi-select" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">curl_multi_select</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">curl_multi_select</span> &mdash; <span class="dc-title">等待，直到任何 cURL 多句柄连接可以进行读取或写入</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.curl-multi-select-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>curl_multi_select</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$mh</code></span>, <span class="methodparam"><span class="type"><a href="language.types.float.php" class="type float">float</a></span> <code class="parameter">$timeout</code><span class="initializer"> = 1.0</span></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <p class="para rdfs-comment">
    堵塞脚本执行，直到附加到 cURL 多句柄的 cURL 句柄能够在下次调用
    <span class="function"><a href="function.curl-multi-exec.php" class="function">curl_multi_exec()</a></span> 时取得进展或者直到超时（以先到者为准）。
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-function.curl-multi-select-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    <dt><code class="parameter">multi_handle</code>
</dt><dd><p class="para">由 
<span class="function"><a href="function.curl-multi-init.php" class="function">curl_multi_init()</a></span> 返回的 cURL 多个句柄。</p></dd>
    
     <dt><code class="parameter">timeout</code></dt>
     <dd>
      <p class="para">
       以秒为单位，等待活跃 cURL 多句柄连接的响应时间。
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.curl-multi-select-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回描述符集合中活跃描述符的数量。如果没有任何活动的描述符，则为
   <code class="literal">0</code>。失败时，此函数将在 <code class="literal">select()</code>
   失败时返回 <code class="literal">-1</code>（来自底层 select 系统调用）。
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.curl-multi-select-errors">
  <h3 class="title">错误／异常</h3>
  <p class="simpara">
   如果 <code class="parameter">timeout</code> 小于 <code class="literal">0</code>
   或者大于 <strong><code><a href="reserved.constants.php#constant.php-int-max">PHP_INT_MAX</a></code></strong>，则抛出 <span class="exceptionname"><a href="class.valueerror.php" class="exceptionname">ValueError</a></span>。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.curl-multi-select-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.4.0</td>
      <td>
       如果 <code class="parameter">timeout</code> 小于 <code class="literal">0</code>
       或者大于 <strong><code><a href="reserved.constants.php#constant.php-int-max">PHP_INT_MAX</a></code></strong>，现在抛出 <span class="exceptionname"><a href="class.valueerror.php" class="exceptionname">ValueError</a></span>。
      </td>
     </tr>

     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">multi_handle</code> expects a <span class="classname"><a href="class.curlmultihandle.php" class="classname">CurlMultiHandle</a></span>
  instance now; previously, a <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> was expected.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.curl-multi-select-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.curl-multi-init.php" class="function" rel="rdfs-seeAlso">curl_multi_init()</a> - 返回新 cURL 批处理句柄</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>