Skip to content

Instantly share code, notes, and snippets.

@jrelo
Forked from viliampucik/perl-udp-daemon.pl
Created November 9, 2017 22:03
Show Gist options
  • Save jrelo/97f4c775d3cc950ba1ee0b806b6e55ab to your computer and use it in GitHub Desktop.
Save jrelo/97f4c775d3cc950ba1ee0b806b6e55ab to your computer and use it in GitHub Desktop.
perl -MPOSIX -MIO::Socket -We '
my $s = IO::Socket::INET->new(
Proto => "udp",
LocalAddr => "0.0.0.0:162"
);
while ( $s->recv( $_, 65535 ) ) {
print strftime( "%F %T", localtime ), " ", $s->peerhost(), " $_\n";
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment