Today I have studied the differences between CURLOPT_CONNECTTIMEOUT and CURLOPT_TIMEOUT ), this parameter is used to cope with the overload, deprecation, or crash of the target server. CURLO
Today I have studied the differences between CURLOPT_CONNECTTIMEOUT and CURLOPT_TIMEOUT ), this parameter is used to cope with the overload, deprecation, or crash of the target server. CURLO
We have studied the differences between CURLOPT_CONNECTTIMEOUT and CURLOPT_TIMEOUT:
CURLOPT_CONNECTTIMEOUT is used to tell the PHP script how long it will wait before successfully connecting to the server (the buffer output will start after the connection is successful). This parameter is used to cope with the overload and deprecation of the target server, or crash;
CURLOPT_TIMEOUT is used to tell the successful PHP script how long it will wait before the server receives the buffer. This parameter is useful if the target file is a huge file and the content generation speed is too slow or the link speed is too slow.
Downloading MP3 files using cURL is a good example for developers. CURLOPT_CONNECTTIMEOUT can be set to 10 seconds. If the server does not respond within 10 seconds, the script will be disconnected. CURLOPT_TIMEOUT can be set to 100. If the MP3 file is not downloaded within 100 seconds, the script will be disconnected.
Original article: http://www.quora.com/Whats-the-difference-between-CURLOPT_CONNECTTIMEOUT-and-CURLOPT_TIMEOUT