General discussion

Locked

Broadcasting Data Grams

By saratchandra_a ·
Hai,
Please provide me with some working code that broadcasts a datagram over the local area netwrok. I have tried using setsockopt but it gives me error if I set the SO_BROADCAST FLAG AT THE SOL_SOCKET LEVEL. I will be grateful to you if you get me out of it.
Thank you

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by DSR28 In reply to Broadcasting Data Grams

You just need to "send" the UPD packet to the broadcast address for the network, and it will be broadcast!

(The broadcast network address is the last address in the subnet) For example, with a netmask of 255.255.255.0, the bcast address for IP address block 192.168.1.1 is 192.168.1.255.

I hope this helps

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums