ok
looks like I need to use
IO::Socket::Inet
here's the sample code from cpan
$sock = IO::Socket::INET->new(PeerAddr => 'www.perl.org',
PeerPort => 'http(80)',
Proto => 'tcp');
$sock = IO::Socket::INET->new(PeerAddr => 'localhost:smtp(25)');
$sock = IO::Socket::INET->new(Listen => 5,
LocalAddr => 'localhost',
LocalPort => 9000,
Proto => 'tcp');
$sock = IO::Socket::INET->new('127.0.0.1:25');
$sock = IO::Socket::INET->new(PeerPort => 9999,
PeerAddr => inet_ntoa(INADDR_BROADCA
+ST),
Proto => udp,
LocalAddr => 'localhost',
Broadcast => 1 )
or die "Can't bind : $@\n";
I want to create a listening daemon on port 6969 on any IP device for example and stream the info into a file for now. I can deal with the syslog forwarding.
Which of the example sets should I use? I'm a little confused on which I should use
I think it should be:
$sock = IO::Socket::INET->new(Listen => 5,
LocalAddr => 'localhost',
LocalPort => 6969,
Proto => 'udp');
someone give me a little example code of what I should do?
Thanks
|