[Twisted-Python] twisted.names.error.DNSNameError on MacOsX but not on linux

Ralph Meijer twisted at ralphm.ik.nu
Thu Aug 13 03:22:51 MDT 2009


On Tue, 2009-08-11 at 18:30 +0200, Gabriel Rossetti wrote:
> [..]

Apparently you modified the original example here:

> [..]
>         connector = XMPPClientConnector(reactor, "10.204.232.117", f)
>         connector.connect()

This would never work properly. XMPPClientConnector is designed to do an
SRV record look up on the /domain/ provided as its second argument. You
pass an IP address here and that will just fail.

The original example passes client_jid.host. This extracts the domain
from the JID you want to connect with and then follows the procedure of
first trying to find xmpp-server SRV records for that domain, and if
that fails, try to connect to the host that the domain name resolves to,
using the default port (5222), as outlined in RFC 3920. Note that
XMPPClientConnector avoids the problems sketched in ticket #3456 that
was mentioned by Jean-Paul.

If you really want to connect to a specific host instead of following
the above procedure, you can do this instead of the code quoted above:

    reactor.connectTCP("10.204.232.117", 5222, f)

-- 
Groetjes,

ralphm
-- 
Groetjes,

ralphm





More information about the Twisted-Python mailing list