Reflex::Role::UdpPeer - Turn an object into a UDP network peer.
version 0.005
{ package Reflex::UdpPeer::Echo; use Moose; with 'Reflex::Role::UdpPeer'; sub on_udppeer_datagram { my ($self, $args) = @_; my $data = $args->{datagram}; if ($data =~ /^\s*shutdown\s*$/) { $self->destruct(); return; } $self->send( datagram => $data, remote_addr => $args->{remote_addr}, ); } sub on_udppeer_error { my ($self, $args) = @_; warn "$args->{op} error $args->{errnum}: $args->{errstr}"; $self->destruct(); } }
Reflex::Role::UdpPeer is an alternative to inheriting from Reflex::UdpPeer directly.
TODO - Complete the documentation.
"GETTING HELP" in Reflex
"ACKNOWLEDGEMENTS" in Reflex
Reflex and "SEE ALSO" in Reflex
"BUGS" in Reflex
"CORE AUTHORS" in Reflex
"OTHER CONTRIBUTORS" in Reflex
"COPYRIGHT AND LICENSE" in Reflex
To install Reflex, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Reflex
CPAN shell
perl -MCPAN -e shell install Reflex
For more information on module installation, please visit the detailed CPAN module installation guide.