Hello,

I've tried to use Twisted names.client.getHostByName() method to resolve
some addresses for my UDP based app. By default getHostByName() always
returns IPv6 address. I don't always have end-to-end IPv6 connectivity, so
it often causes communication to fail. I've found a solution to override
this behavior with monkey patching [1].

After Twisted 13.2 announcement I've checked the new HostnameEndpoint
implementation to find possible solution (it seems to be dedicated to solve
similar problems, but for TCP-based protocols). However it seems to use
deferToThread(), and built-in Python getaddrinfo().

My questions:
1. Is using deferToThread() a preferred solution?
2. Does someone know a less hacky solution to get IPv4 addresses with
getHostbyName()?

Best Regards
Maciej Wasilak

[1]
http://stackoverflow.com/questions/13820175/can-twisted-names-client-be-forced-to-return-ipv4-addresses-without-modifying
_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to