use IO::Socket::IP and fix null reply
[spider.git] / perl / DXUDP.pm
index 28daf805b7c4b554c947de42fac1bc9fd82cd94b..fda14c6f8680ff43e9f1b1cae09adfa641b16810 100644 (file)
@@ -39,6 +39,7 @@ A simple Mojo compatible UDP thingy
 use Mojo::Base 'Mojo::EventEmitter';
 use Mojo::IOLoop;
 use Scalar::Util qw(weaken);
+use IO::Socket::INET6;
 
 our $VERSION = '0.04';
 
@@ -139,6 +140,8 @@ sub _incoming {
        $self->emit(read => $datagram);
 }      
 
+has peerhost => sub { return $_[0]->{socket}->peerhost };
+has peerport => sub { return $_[0]->{socket}->peerport };
 
 sub DEMOLISH {
     my $self = shift;