Perl UDP Daemon

A simple UDP daemon listening on UDP/162 port.
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";
}'

No comments:

Post a Comment