fjonckers has asked for the wisdom of the Perl Monks concerning the following question:
in Windows it works fine (activeperl)send: Cannot determine peer address at udp.pl line 24
#!/usr/bin/perl # use strict; use IO::Socket; # defaults my $bcaddr = '192.168.254.255'; my $port = 9870; # open UDP socket my $sock = IO::Socket::INET->new( Proto=>'udp', LocalPort=>$port, PeerHost=>$bcaddr, PeerPort=>$port) or die "new socket:$@"; # 10 udp's on the wire for (my $i=0;$i < 10;$i++) { my $data = 'UDP packet ' . $i; # send udp packet $sock->send($data) || die "send(): $!"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: udp broadcast: doesn't work in Linux
by fjonckers (Novice) on Oct 12, 2001 at 01:27 UTC | |
|
Re: udp broadcast: doesn't work in Linux
by cjensen (Sexton) on Oct 11, 2001 at 21:39 UTC | |
by fjonckers (Novice) on Oct 11, 2001 at 23:34 UTC | |
by cjensen (Sexton) on Oct 12, 2001 at 00:39 UTC | |
|
Re: udp broadcast: doesn't work in Linux
by perrin (Chancellor) on Oct 11, 2001 at 21:17 UTC | |
|
Re: udp broadcast: doesn't work in Linux
by Anonymous Monk on Oct 11, 2001 at 23:07 UTC | |
by fjonckers (Novice) on Oct 11, 2001 at 23:25 UTC |