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

Reply via email to