[aprssig] Perl socket programming

Andrew Rich vk4tec at people.net.au
Thu Apr 10 08:52:12 EDT 2008


Any one good at socket programming ?

I am trying to UDP some hex characters.

Something so simple is turning out to be hard to find.

Here is how to do it as a string, I just want to send hex instead

#!/usr/bin/perl -w
# clientIO.pl - a simple client using
# IO::Socket
use strict;
use IO::Socket;
my $host = shift || 'localhost';
my $port = shift || 30003;
my $sock = new IO::Socket::INET(
                   PeerAddr => $host,
                   PeerPort => $port,
                   Proto    => 'udp');
$sock or die "no socket :$!";
foreach my $i (1..10) {
    print $sock "hello, world: $i\n";
sleep 1;
}
close $sock;                     
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tapr.org/pipermail/aprssig_lists.tapr.org/attachments/20080410/8cff7d89/attachment.html>


More information about the aprssig mailing list