Do you know where your variables are? | |
PerlMonks |
How Do I Do an IP Broadcast in Perl?by HalNineThousand (Beadle) |
on Sep 26, 2010 at 18:46 UTC ( [id://862109]=perlquestion: print w/replies, xml ) | Need Help?? |
HalNineThousand has asked for the wisdom of the Perl Monks concerning the following question: I read a similar thread that provided an answer that didn't work. I need to find a computer on a LAN. I'll have minimal information, but I can make sure it listens and responds on a socket, so I want to write a program that sends out a broadcast signal on the LAN. The other computer would receive that signal (which would include the IP address) and be able to send a message back saying, "I'm here!" I can handle the rest, but I don't know how to open a socket and send a broadcast message to the LAN. (I know how to get the subnet and all else, just can't send the broadcast!) I did find this in another thread:
I did change the IP address to my broadcast address, but could never open that socket. I also tried adding the setting "Type=>SOCK_STREAM" but that didn't help. How can I use Perl to send a broadcast message to a LAN? Thanks!
Back to
Seekers of Perl Wisdom
|
|