<div class="gmail_quote">On Thu, Jan 19, 2012 at 8:19 AM, Facundo Batista <span dir="ltr">&lt;<a href="mailto:facundobatista@gmail.com">facundobatista@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have some code that uses a twisted.web.client.HTTPClientFactory.<br>
<br>
I&#39;ve found that because some issues (firewall rules, not relevant to<br>
the problem), I experienced failures to connect.<br>
<br>
More specifically, I told it to connect to one particular address, and<br>
because of DNS load distribution, that address converted to several<br>
different IPs, and one of that IPs was not open, so it failed to<br>
connect with a TCPTimedOutError (code 110).<br>
<br>
When it failed to connect, it executed the &quot;clientConnectionFailed&quot;<br>
method of HTTPClientFactory, which receives a<br>
twisted.internet.tcp.Connector instance, and the reason of the<br>
failure.<br>
<br>
The question is: Is there a way, at that point (when<br>
clientConnectionFailed is called), to find out *to which IP* it failed<br>
to connect?<br>
<br>
Thank you very much!<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
.    Facundo<br>
<br>
Blog: <a href="http://www.taniquetil.com.ar/plog/" target="_blank">http://www.taniquetil.com.ar/plog/</a><br>
PyAr: <a href="http://www.python.org/ar/" target="_blank">http://www.python.org/ar/</a></font></span><br></blockquote></div><br>twisted.internet.tcp.Connector has a getDestination() method, which should return an address object.<br>
<br>Have you tried that? (I haven&#39;t, but it looks like the right thing)<br><br>Kevin Horn<br>