AnyEvent-Handle-UDP

 view release on metacpan or  search on metacpan

examples/anyevent-udp-server.pl  view on Meta::CPAN


=cut

use strict;
use warnings;

use AnyEvent::Handle::UDP;
use AnyEvent::Log ();

# Default for AnyEvent is to log nothing
$AnyEvent::Log::FILTER->level('debug');

# AE::Handle::UDP does all for us:
# be sure to use the "bind" option!
my $udp_server = AnyEvent::Handle::UDP->new(
    # Bind to this host and port
    bind => ['0.0.0.0', 4000],

    # AnyEvent will run this callback when getting some input
    on_recv => sub {
        my ($data, $ae_handle, $client_addr) = @_;



( run in 0.553 second using v1.01-cache-2.11-cpan-49f99fa48dc )