Subject: | Bug |
Date: | Tue, 19 Jun 2007 19:34:30 +0200 |
To: | bug-POE-Component-Client-DNS [...] rt.cpan.org |
From: | robertmich <robertmich [...] o2.pl> |
Code:
--8<-------------------------------------------------------------8<--
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use POE qw/Component::Client::DNS/;
our $dns = POE::Component::Client::DNS->spawn(Alias => 'dns');
our $session = POE::Session->create
(
inline_states =>
{
_start => sub
{
my $query = $dns->resolve
(
event => 'response',
context => {},
timeout => 5,
host => 'serwer.waw.pl',
type => 'NS',
);
$_[KERNEL]->yield(response => $query) if ($query);
},
response => sub { print Dumper $_[ARG0] },
}
);
$poe_kernel->run();
--8<-------------------------------------------------------------8<--
Returns:
$VAR1 = {
'response' => undef,
'error' => 'additional section incomplete',
'context' => {},
'class' => 'IN',
'type' => 'NS',
'host' => 'serwer.waw.pl'
};
# host -t ns serwer.waw.pl
serwer.waw.pl name server dns4.serwer.waw.pl.
serwer.waw.pl name server hura.dns.net.pl.
serwer.waw.pl name server dns4.locogroup.com.
serwer.waw.pl name server ursynow.dns.net.pl.
serwer.waw.pl name server dns2.serwer.waw.pl.
serwer.waw.pl name server master.dns.net.pl.
serwer.waw.pl name server dns3.serwer.waw.pl.
serwer.waw.pl name server dns1.locogroup.net.
serwer.waw.pl name server dns2.locogroup.net.
serwer.waw.pl name server dns1.locogroup.com.
serwer.waw.pl name server dns1.serwer.waw.pl.
serwer.waw.pl name server slave.dns.net.pl.
serwer.waw.pl name server dns3.locogroup.net.
serwer.waw.pl name server dns2.locogroup.com.
serwer.waw.pl name server dns4.locogroup.net.
serwer.waw.pl name server dns3.locogroup.com.
I think, PoCo::Client::DNS doesn't wait for next packets, if response doesn't fit in one packet.