On Thu, 8 Apr 2010, Ruben Thijssen wrote:

Please don't top-post!

The Primary IP is indeed what I am looking for I think. But I am using the .NET edition (c#) of curl and I don't think this information item is implemented yet (correct me if I'm wrong).

You better investigate your binding code and see for yourself. In most cases extending such things are also fairly easy so quite possibly you can make this option supported here without too much trouble.

When connecting to an domain, say for example google.nl you can create an connection with more than 1 IP address (there are more IP addresses linked to one domain address).

That's not strictly correct.

The host name resolves to multiple addresses, which means that the DNS server returns a list of addresses for that single host. libcurl will then walk through that list of addresses and attempt to connect to them one by one until one works (which in most cases is the first address it tries).

(Connecting to more than one IP may become reality in a future when/if MPTCP becomes reality: http://daniel.haxx.se/blog/2009/07/31/multipath-tcp/)

So what I want to know is: Which IP address is Curl using when it is getting a list of IP address from one domain address. If I know this I know which IP address I have visited when connecting to an domain.

As mentioned, the CURLINFO_PRIMARY_IP option is pretty much made for figuring out the address in cases such as this and we can't but recommend that you use it!

--

 / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to