How to send broadcast IP address to network?

Chris Angelico rosuav at gmail.com
Fri Aug 23 10:11:07 EDT 2013


On Fri, Aug 23, 2013 at 10:32 PM,  <lightaiyee at gmail.com> wrote:
> I want to send a broadcast packet to all the computers connected to my home router.
>
> The following 2 lines of code do not work;
> host="192.168.0.102"
> s.connect((host, port))
>
> Can someone advise?

You can't establish a TCP socket with a broadcast address. That just
doesn't work. Can you please show a whole lot more context so we can
see what's happening here? Thanks!

ChrisA



More information about the Python-list mailing list