<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Christopher Zorn wrote:
<blockquote
 cite="mid:149014b90812020559y6ece4376ld5dbc46df31a779a@mail.gmail.com"
 type="cite"><br>
  <br>
  <div class="gmail_quote">On Tue, Dec 2, 2008 at 8:21 AM, Gabriel
Rossetti <span dir="ltr">&lt;<a moz-do-not-send="true"
 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'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'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't get is the client never returns an error if nobody'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 ('<a moz-do-not-send="true"
 href="http://192.168.2.1">192.168.2.1</a>', 53) to server list<br>
2008-12-02 08:57:02-0500 [-] &lt;class
'twisted.names.dns.DNSDatagramProtocol'&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 class="Wj3C7c"><br>
Gabriel<br>
    <br>
______________________</div>
    </div>
  </blockquote>
  </div>
  <br>
</blockquote>
Ok, I finally created a class that wraps the client.XMPPClientFactory
function and calls callbacks when the connection fails. Thanks<br>
</body>
</html>