On 10/22/06, <b class="gmail_sendername">Santiago Gala</b> &lt;<a href="mailto:santiago.gala@gmail.com">santiago.gala@gmail.com</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Erlang has nothing like socket.getaddrinfo(), what I discovered painfully while trying to adapt ejabberd-mod-irc adapter to ipv6. The listening sockets can be make to work, by using ::1, but having sockets choose the best ipv4/ipv6 address when connecting is not trivial at all.
<br><br>So, if you need ipv6 compatibility, erlang might not be the best solution.<br><br>While at that, how is people handling the intrinsic blocking nature of getaddrinfo() as the first step of dual ipv4/ipv6 client or server connections?
</blockquote><div><br>As for Twisted, it has two major options for this: either you can run it in a threadpool (unfortunately the default, but for good reasons), or use Twisted's native asynchronous DNS client. The reactor has a pluggable resolver so once you've made the decision to use one of these strategies it's transparent to the rest of your program. The reason that running getaddrinfo in a threadpool is the default is that the native DNS client doesn't support all of the pathological client-side configurations possible that getaddrinfo does, so to use something other than the built-in gethostbyname or getaddrinfo would mean your program can behave subtly or completely differently with respect to name resolution.
<br><br></div></div>-- <br>Christopher Armstrong<br>International Man of Twistery<br><a href="http://radix.twistedmatrix.com/">http://radix.twistedmatrix.com/</a><br><a href="http://twistedmatrix.com/">http://twistedmatrix.com/
</a><br><a href="http://canonical.com/">http://canonical.com/</a><br>