in reply to Re: How Do I Do an IP Broadcast in Perl?
in thread How Do I Do an IP Broadcast in Perl?
I changed the protocol to UDP in the broadcast program and it ran and didn't give me an error or anything. But then when I changed the protocol on the listener to UDP, it kept crashing. I removed the "Listen => 1" and it would run but do nothing.
Here's the code for the listener:
use IO::Socket; my $sock = new IO::Socket::INET ( LocalHost => '172.16.7.101', LocalPort => '7070', Proto => 'udp', # Listen => 1, Reuse => 1, 8 ); die "Could not create socket: $!\n" unless $sock; my $new_sock = $sock->accept(); while(<$new_sock>) { print $_; } close($sock);
So I take it I need to change something to be able to listen on a UDP socket?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How Do I Do an IP Broadcast in Perl?
by ikegami (Patriarch) on Sep 26, 2010 at 21:19 UTC | |
|
Re^3: How Do I Do an IP Broadcast in Perl?
by HalNineThousand (Beadle) on Sep 26, 2010 at 19:34 UTC |