views:

60

answers:

1

i am trying to broadcast a UDP package using subnet. i want to braodcast my package to 192.168.1.255 ? can i do that ? and how using c++ ?

+1  A: 

If you're using C++, I'd recommend using the Boost ASIO package for networking. The only gotcha is to be sure to set the broadcast ability on your UDP socket via:

boost::asio::socket_base::broadcast option(true);
socket.set_option(option);

The "Examples" section of the boost documentation should have plenty of references to get you up and running.

Rakis