Re: Multi handle and boost asio, wont finish
Date: Wed, 26 Feb 2014 08:37:48 +0100
On 2/25/2014 10:59 PM, Daniel Stenberg wrote:
> Please stop the top-posting, I get a head ache just trying to read
> this thread.
> I also didn't see what libcurl version you're using.
Using version: curl-7.34.0
> It *blocks* ? Sorry but I don't see how that can happen. I assume you
> mean that there's a handle in there that doesn't seem to complete?
Yes thats true.
> So you never get any event for the new socket that curl created for
> the TCP connection? Then libcurl won't know the connect failed! Or am
> I missing something?
I get an event.
My socket function (CURLMOPT_SOCKETFUNCTION) gets called with the action
parameter "1" and then i call "boost::socket.:async_write" to wait for
After that curl calls my timeout function and I set my timer.
curl::mulit - onCurlTimer: set new timer -> 224 ms
The timer timeouts and i call curl_multi_socket_action( CURL_SOCKET_TIMEOUT)
Curl is calling my timeout function again, but this time with timeout_ms
"-1" so i wont register a new timer.
Then I have no reaason to call the socket_action again because i have no
timeout set and my "boost::socket.:async_write" does not complete.
This is why I asked if it could be "asio" fault because it wont trigger
an error if the socket it is using in the async_write call is not connected.
> I don't understand. Who is 'I' here that write to the socket? Aren't
> you using libcurl so it will write to the socket by itself? How does
> asio affect that? And libcurl won't write to the socket until after it
> has connected anyway!
Sorry there was a typo.
I call "boost::socket.:async_write" to get informed when curl can write
to the socket. But it seems that this function wont trigger an error if
the socket it uses is not connected.
If I multiply the first timeout value ( 224ms ) with 10 and register a
the timer with 2240 ms, the easy handle completes and I get the correct
error: "connect to 127.0.0.1 port 80 failed: Connection refused".
List admin: http://cool.haxx.se/list/listinfo/curl-library
Received on 2014-02-26