curl-and-python

Re: pyCurl : get IP address of the peer socket

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 9 Sep 2008 12:48:01 +0200 (CEST)

On Tue, 9 Sep 2008, ferrety ferrety wrote:

>> sock = curl.getinfo(pycurl.LASTSOCKET);

> So, is it the right way to do it?

No. The Right Way(tm) is to use PRIMARY_IP, but that requires libcurl 7.19.0
and a pycurl updated to support it.

The LASTSOCKET approach has the fatal flaw that sometimes there's no socket
returned since the connection may have already been closed...

-- 
  / daniel.haxx.se
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2008-09-09