For Programmers: Free Programming Magazines  


Home > Archive > PERL POE > June 2005 > POE::Component::Client::DNS woes









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author POE::Component::Client::DNS woes
Lari Huttunen

2005-06-09, 4:00 am

Dear all,

I have been trying to wrap my brain around the POE framework for a
couple of days reading through the docs and trying out different
things. I managed to modify the reference implementation of concurrent
DNS resolver <URL:http://poe.perl.org/?POE_Cookbook/DNS_Lookups> to a
PERL package, which expects an array ref of IP addresses as input and
returns a hash ref of ip to name mappings as output. This now seems to
work fine, except for the fact that the resolvers utilize only the
first nameserver on the list passed to Net::DNS::Resolver, i.e.

POE::Component::Client::DNS->spawn(
Alias => 'resolver',
Timeout=> 30,
Nameservers => [qw(10.0.0.1 10.0.0.2 10.0.0.3)],
);

will only query the first server on the list (the test material
consisted of about hundred IP adresses).

10.0.0.10.1443 > 10.0.0.1.53: PTR? nn.nn.nn.nn.in-addr.arpa. (44)
10.0.0.10.1444 > 10.0.0.1.53: PTR? nn.nn.nn.nn.in-addr.arpa. (43)
...

In other words the resolution seems to working in parallel, but only
the first name server is queried. I have set the number of parallel
workers to 9 through:

sub INITIAL_COUNT () { 9 }

This doesn't seem a bug in POE unless passing the Nameservers parameter
in POE::Component::Client::DNS is somehow botched, which does not seem
to be the case. Reading the source code for Net::DNS::Resolver did not
yield any obvious answers either.

Any suggestions?

Anyway, thanks for the developers and contributors for a great
parallel programming framework! :) The learning curve is steep
but at least I have been able to take the first wobbly steps through
perusing the rather extensive but "distributed" documentation. ;)

--
Sincerely,

Lari Huttunen

Mathieu Longtin

2005-06-09, 4:00 am

Hum, if the first DNS servers works, why should it try the
other ones?

--- Lari Huttunen <perl-poe-001@huttu.net> wrote:
> Dear all,
>
> I have been trying to wrap my brain around the POE
> framework for a
> couple of days reading through the docs and trying out
> different
> things. I managed to modify the reference implementation
> of concurrent
> DNS resolver
> <URL:http://poe.perl.org/?POE_Cookbook/DNS_Lookups> to a
> PERL package, which expects an array ref of IP addresses
> as input and
> returns a hash ref of ip to name mappings as output. This
> now seems to
> work fine, except for the fact that the resolvers utilize
> only the
> first nameserver on the list passed to
> Net::DNS::Resolver, i.e.
>
> POE::Component::Client::DNS->spawn(
> Alias => 'resolver',
> Timeout=> 30,
> Nameservers => [qw(10.0.0.1 10.0.0.2 10.0.0.3)],
> );
>
> will only query the first server on the list (the test
> material
> consisted of about hundred IP adresses).
>
> 10.0.0.10.1443 > 10.0.0.1.53: PTR?
> nn.nn.nn.nn.in-addr.arpa. (44)
> 10.0.0.10.1444 > 10.0.0.1.53: PTR?
> nn.nn.nn.nn.in-addr.arpa. (43)
> ..
>
> In other words the resolution seems to working in
> parallel, but only
> the first name server is queried. I have set the number
> of parallel
> workers to 9 through:
>
> sub INITIAL_COUNT () { 9 }
>
> This doesn't seem a bug in POE unless passing the
> Nameservers parameter
> in POE::Component::Client::DNS is somehow botched, which
> does not seem
> to be the case. Reading the source code for
> Net::DNS::Resolver did not
> yield any obvious answers either.
>
> Any suggestions?
>
> Anyway, thanks for the developers and contributors for a
> great
> parallel programming framework! :) The learning curve is
> steep
> but at least I have been able to take the first wobbly
> steps through
> perusing the rather extensive but "distributed"
> documentation. ;)
>
> --
> Sincerely,
>
> Lari Huttunen
>
>


________________________________________
__________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com