Setting millisecond-timeouts with curl
I'm currently working on a project where I need to curl to an external server to get some information. If this takes too long, I fall back to a local solution. The timeout for this should be really, really low, so we decided on a 250ms timeout. While testing with this timeout feature, for some reason it *always* used the local fallback. I couldn't figure out why, as when I did a manual curl to the external server, it took 50ms at maximum, way below the timeout value. Turns out it is a problem with libcurl.
posted on April 13, 2012 - 21 comment(s) - tags: php, curl, timeout, libcurl