curl timeout vs socket timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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);

Here we use frwrite() and fread() to send the request and read the
response respectively.


In (1),  how is the timeout applied - is it:

a) timeout includes the entire curl_exec() call - the combined socket
write()  ( to send the request ) and
    the  read() ( read the response ) calls.

or

b) timeout is independently applied to write() and read() end respectively.

Some of our tests seem to indicate it is (a).


In (2), I am assuming the stream timeout is applied at each i/o call
independently for fwrite() and fread() - I am pretty
much certain on this as this is how it would map to underlying C calls.....


It will be good to get a confirmation on our doubts.

Thanks,
Ravi

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux