Subject: | ->peerhost/->peerport exception on IO::Async::Listener handle? |
See test script - seems odd that this would raise an exception, but if it's expected behaviour I'd suggest maybe changing the message or documenting what it means.
At the moment it reports:
addr is not a string at .../IO/Socket/IP.pm line 750
so the error is probably coming from Socket::getnameinfo - if it's not a string, (a) what is it, and (b) why isn't it the expected value?
cheers,
Tom
Subject: | io-socket-ip-peerhost.t |
use strict;
use warnings;
use Test::More;
use Test::Fatal;
use IO::Async::Loop;
my $loop = IO::Async::Loop->new;
my ($listener) = $loop->listen(
addr => {
family => "inet",
socktype => "stream",
},
on_accept => sub {
note "Accept: @_";
}
)->get;
my $sock = $listener->read_handle;
note $sock;
is(exception {
note "Server listening on " . join(':', $sock->peerhost, $sock->peerport);
}, undef, 'no exception when checking peerhost/peerport');
done_testing;