-
Notifications
You must be signed in to change notification settings - Fork 56
/
curl-upkeep.xml
103 lines (97 loc) · 2.96 KB
/
curl-upkeep.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 1139146aa49b99fd29fab078199b25b2811a6447 Maintainer: mumumu Status: ready -->
<refentry xml:id="function.curl_upkeep" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>curl_upkeep</refname>
<refpurpose>接続を維持するためのチェックを行う</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>curl_upkeep</methodname>
<methodparam><type>CurlHandle</type><parameter>handle</parameter></methodparam>
</methodsynopsis>
<para>
この関数は、libcurl >= 7.62.0 でビルドした場合に利用可能です。
</para>
<para>
プロトコルによっては、"接続を維持する" 仕組みを備えているものがあります。
通常、この仕組みは接続を維持するため、既存の接続に対して少量のトラフィックを送信します。
たとえばこうすることで、熱心なファイアウォールが接続を閉じることを防ぐことができます。
</para>
<para>
こうした接続を維持する仕組みは、現状 HTTP/2 の接続でのみ利用できます。
通常、少量のトラフィックが接続を維持するために送信されます。
HTTP/2 プロトコルは、HTTP/2 PING フレームを送信することで、接続を維持します。
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&curl.ch.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>curl_upkeep</function> の例</title>
<programlisting role="php">
<![CDATA[
<?php
$url = "https://example.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_2_0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_UPKEEP_INTERVAL_MS, 200);
if (curl_exec($ch)) {
usleep(300);
var_dump(curl_upkeep($ch));
}
curl_close($ch);
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>curl_init</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- 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:"~/.phpdoc/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
-->