2003-05-10 22:18:33 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2007-06-01 03:01:42 +00:00
|
|
|
<!-- $Revision: 1.4 $ -->
|
2007-01-16 20:18:05 +00:00
|
|
|
<refentry id="function.curl-multi-add-handle">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>curl_multi_add_handle</refname>
|
|
|
|
<refpurpose>Add a normal cURL handle to a cURL multi handle</refpurpose>
|
|
|
|
</refnamediv>
|
2007-01-17 00:14:52 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2007-01-16 20:18:05 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>int</type><methodname>curl_multi_add_handle</methodname>
|
|
|
|
<methodparam><type>resource</type><parameter>mh</parameter></methodparam>
|
|
|
|
<methodparam><type>resource</type><parameter>ch</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
2007-01-17 00:14:52 +00:00
|
|
|
<para>
|
|
|
|
Adds the <parameter>ch</parameter> handle to the multi handle
|
|
|
|
<parameter>mh</parameter>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
&curl.mh.description;
|
|
|
|
&curl.ch.description;
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-01-16 20:18:05 +00:00
|
|
|
|
2007-01-17 00:14:52 +00:00
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
|
|
|
Returns 0 on success, or one of the <constant>CURLM_XXX</constant> errors
|
|
|
|
code.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-06-01 03:01:42 +00:00
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title><function>curl_multi_add_handle</function> example</title>
|
|
|
|
<para>
|
|
|
|
This example will create two cURL handles, add them to a multi
|
|
|
|
handle, and then run them in parallel.
|
|
|
|
</para>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
// create both cURL resources
|
|
|
|
$ch1 = curl_init();
|
|
|
|
$ch2 = curl_init();
|
|
|
|
|
|
|
|
// set URL and other appropriate options
|
|
|
|
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
|
|
|
|
curl_setopt($ch, CURLOPT_HEADER, 0);
|
|
|
|
curl_setopt($ch, CURLOPT_URL, "http://www.php.net/");
|
|
|
|
curl_setopt($ch, CURLOPT_HEADER, 0);
|
|
|
|
|
|
|
|
//create the multiple cURL handle
|
|
|
|
$mh = curl_multi_init();
|
|
|
|
|
|
|
|
//add the two handles
|
|
|
|
curl_multi_add_handle($mh,$ch1);
|
|
|
|
curl_multi_add_handle($mh,$ch2);
|
2007-01-16 20:18:05 +00:00
|
|
|
|
2007-06-01 03:01:42 +00:00
|
|
|
//execute the handles
|
|
|
|
curl_multi_exec($mh);
|
|
|
|
|
|
|
|
//close all the handles
|
|
|
|
curl_multi_close();
|
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2007-01-17 00:14:52 +00:00
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
|
|
|
<para>
|
|
|
|
<simplelist>
|
|
|
|
<member><function>curl_multi_remove_handle</function></member>
|
|
|
|
<member><function>curl_multi_init</function></member>
|
|
|
|
<member><function>curl_init</function></member>
|
|
|
|
</simplelist>
|
|
|
|
</para>
|
2007-01-16 20:18:05 +00:00
|
|
|
</refsect1>
|
2007-01-17 00:14:52 +00:00
|
|
|
|
2007-01-16 20:18:05 +00:00
|
|
|
</refentry>
|
2003-05-10 22:18:33 +00:00
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|