<br><br><div class="gmail_quote">On Tue, Dec 2, 2008 at 8:21 AM, Gabriel Rossetti <span dir="ltr">&lt;<a href="mailto:gabriel.rossetti@arimaz.com">gabriel.rossetti@arimaz.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Gabriel Rossetti wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello everyone,<br>
<br>
I wrote an XMPP client and I have a question, when it tries to connect and the server is not listening, it doesn&#39;t send back an error and tries forever. I see that this function (twisted/names/srvconnect.py):<br>
<br>
def _ebGotServers(self, failure):<br>
 &nbsp; &nbsp; &nbsp; failure.trap(DNSNameError)<br>
<br>
 &nbsp; &nbsp; &nbsp; # Some DNS servers reply with NXDOMAIN when in fact there are<br>
 &nbsp; &nbsp; &nbsp; # just no SRV records for that domain. Act as if we just got an<br>
 &nbsp; &nbsp; &nbsp; # empty response and use fallback.<br>
<br>
 &nbsp; &nbsp; &nbsp; self.servers = []<br>
 &nbsp; &nbsp; &nbsp; self.orderedServers = []<br>
<br>
traps the exception so it never propagates to me, so I can&#39;t handle it. Any ideas? I using the XMPP client example as a base for my code.<br>
<br>
Thank you,<br>
Gabriel<br>
</blockquote></div>
Ok, the code I showed has nothing to do with the problem I think, what I don&#39;t get is the client never returns an error if nobody&#39;s listening...<br>
</blockquote><div><br>It may be better to show a log of what is happening. <br><br>It should show something like the following :<br><br>2008-12-02 08:57:01-0500 [-] reactor class: twisted.internet.selectreactor.SelectReactor.<br>
2008-12-02 08:57:01-0500 [-] Starting factory &lt;twisted.words.protocols.jabber.xmlstream.XmlStreamFactory object at 0xf6b490&gt;<br>2008-12-02 08:57:02-0500 [-] /etc/resolv.conf changed, reparsing<br>2008-12-02 08:57:02-0500 [-] Resolver added (&#39;<a href="http://192.168.2.1">192.168.2.1</a>&#39;, 53) to server list<br>
2008-12-02 08:57:02-0500 [-] &lt;class &#39;twisted.names.dns.DNSDatagramProtocol&#39;&gt; starting on 31847<br>2008-12-02 08:57:02-0500 [-] Starting protocol &lt;twisted.names.dns.DNSDatagramProtocol object at 0xfb9a90&gt;<br>
2008-12-02 08:57:02-0500 [-] (Port 31847 Closed)<br>2008-12-02 08:57:02-0500 [-] Stopping protocol &lt;twisted.names.dns.DNSDatagramProtocol object at 0xfb9a90&gt;<br>2008-12-02 08:57:02-0500 [-] &lt;twisted.names.srvconnect.SRVConnector instance at 0xa236c8&gt; will retry in 2 seconds<br>
2008-12-02 08:57:02-0500 [-] Stopping factory &lt;twisted.words.protocols.jabber.xmlstream.XmlStreamFactory object at 0xf6b490&gt;<br><br>This will keep trying until you quit. You can set a limit on how many times it retries. <br>
<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Best regards,<div><div></div><div class="Wj3C7c"><br>
Gabriel<br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com" target="_blank">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</div></div></blockquote></div><br>