cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Strange behavior with multi-interface and async DNS-resolve on windows

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 3 Apr 2012 23:21:47 +0200 (CEST)

On Sun, 25 Mar 2012, Lijo Antony wrote:

> Here we can see that curl uses socket 6 for transfer, which is the external
> socket returned by the opensocket callback. But curl also creates another
> socket, socket 7 internally, and it is being used during the name lookup. I
> am not sure this is a dummy socket mentioned earlier but I believe this is
> the same behavior observed by Christian on windows as well.

Are you using a libcurl built with c-ares for name resolves?

> My issue with this extra socket is, since I don't open this socket, I cannot
> manage this socket using boost::asio library on windows.

Very true. libcurl does not guarantee that every socket it uses is created
with the callback. In the c-ares case, there's a fix to be made actually as
c-ares provides a callback of its own (with ares_set_socket_callback, added in
c-ares 1.6.0) so we can in fact fix this - assuming you are using c-ares here.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-04-03