Re: [PHP] curl timeout vs socket timeout

2008-01-30 Thread Richard Lynch
On Mon, January 28, 2008 3:56 pm, Ravi Menon wrote: > 1) curl: > > . > . > curl_setopt( $handle, CURLOPT_TIMEOUT, 1 ); > . > . > $resp = curl_exec($handle) > > > 2) sockets: > > stream_set_timeout( $sock, 1); This is only for AFTER you've already opened up the socket. If you want a timeout on the

Re: [PHP] curl timeout vs socket timeout

2008-01-28 Thread Jim Lucas
Ravi Menon wrote: Hi, We have two versions of client code, one using curl, and other one using raw sockets via fsockopen(), and we use the following code to set the i/o timeouts: 1) curl: . . curl_setopt( $handle, CURLOPT_TIMEOUT, 1 ); From the manual CURLOPT_TIMEOUT The maximum number of se

[PHP] curl timeout vs socket timeout

2008-01-28 Thread Ravi Menon
Hi, We have two versions of client code, one using curl, and other one using raw sockets via fsockopen(), and we use the following code to set the i/o timeouts: 1) curl: . . curl_setopt( $handle, CURLOPT_TIMEOUT, 1 ); . . $resp = curl_exec($handle) 2) sockets: stream_set_timeout( $sock, 1);