Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to broadcast a message in a network?

I'm working on a client-server application written in C. I want to broadcast a message to all the machines available on the local network.

How can I do that using the usual socket system calls in C?

like image 308
Zenet Avatar asked Feb 27 '10 13:02

Zenet


1 Answers

Just send the message to the broadcast address of your subnet, which for 192.168.0.0/24 is 192.168.0.255, or just broadcast to 255.255.255.255.

like image 147
Enrico Carlesso Avatar answered Oct 29 '22 17:10

Enrico Carlesso