Summary

Broadcasting is a powerful technique for discovering resources on the local area network. Sending broadcasts is simple, provided that you know the correct subnet-directed broadcast IP address to use. If not, you can determine it at runtime using the IO::Interface module (either the pure-Perl version developed here or the C extension module available from CPAN).

Receiving broadcasts is even easier. Any datagram-based server will receive broadcasts without any overt action on the programmer's part.

Broadcasting has some important limitations. It is useful only in the local area subnetwork because routers will not forward broadcast packets. Broadcasting is not selective. A host machine cannot opt out of receiving broadcasts any more than ...

Get Network Programming with Perl now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.