cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Getting IP Adress.

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 12 Apr 2007 15:29:45 -0700

On Thu, Apr 12, 2007 at 06:36:52PM -0300, Gustavo Elias Siqueira wrote:
> Hi everybody,
> is there a way to get the IP Adress after a Perform Command using DLL libcurl?
> If not, a good soul can tell me a fast way to get the IP providing a DNS?

Calling curl_easy_getinfo with CURLINFO_LASTSOCKET and then calling
getsockname(2) on that should work in most cases (on UNIX at least).
Resolving the DNS of the original URL host isn't always going to give
you the correct answer on a multihomed server.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2007-04-13