Any reccomendations of a libary which I can call from my Linux (C) app to send simple log messages to anyone who happens to be listening on the network, using Multicast UDP?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You don’t need a library to send a multicast packet. Sending a UDP message to a multicast socket is only marginally more complicated than sending one to a unicast address.
In particular you’ll need to use
setsockoptto set theIP_MULTICAST_TTLof your packets.The receiving side is slightly harder – you have to join a particular multicast group using
setsockoptwithIP_ADD_MEMBERSHIPto be able to receive the messages sent to it.These options are all documented in
man 7 ip.