initial commit
[m6w6/m6w6.github.io] / _posts / 2008-12-05-peclhttp-and-sub-second-timeouts.md
1 ---
2 title: pecl_http and sub-second timeouts
3 author: m6w6
4 tags:
5 - PHP
6 ---
7
8 Just a quick info, because I forget this again and again -- and it's not noted
9 in the [documentation](http://php.net/manual/en/ref.http.php) yet either.
10
11 Sub-second timeouts are supported by [libcurl](http://curl.haxx.se/libcurl/)
12 and thus by [pecl_http](http://pecl.php.net/pecl_http) -- yes but only if
13 libcurl is built with [(c-)ares](http://c-ares.haxx.se) support:
14
15 <quote url="[curl_easy_setopt.html](http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTTIMEOUTMS)">
16
17 > If libcurl is built to use the standard system name resolver, that portion
18 of the transfer will still use full-second resolution for timeouts with a
19 minimum timeout allowed of one second.
20
21 </quote>
22