lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 20 November 2013 13:12, kamicc olo <kamicc@gmail.com> wrote:
On 11/19/13, Sean Conner <sean@conman.org> wrote:

>> 3) Linux has a lovely getaddrinfo_a() that does lookups in parallel...
>> you
>> could start multiple worker threads with something like lua-lanes to do
>> individual getaddrinfo()'s but that's a lot of responsibility/liability
>> on
>> you... I wish getaddrinfo_a() were portable XD
>
>   Which distribution of Linux?  I tried four different Linux distributions
> and none of them had getaddrinfo_a().

Note from `man 3 getaddrinfo_a`:
CONFORMING TO
    These functions are GNU extensions; they first appeared in glibc
in version 2.2.3.

Debian 7.0 in my case.

And infact, all it does is use getaddrinfo() in another thread.
This causes hours of fun when your program doesn't use pthreads elsewhere ( http://cygwin.com/ml/libc-help/2012-07/msg00024.html )

In the end; is probably is better to just use something like lanes to do it yourself.
Infact, the conclusion I usually end up is intergrating a real dns library into my main socket handling loop.