UDP binding interface


I would like to know what should be set to the interface for joining a multicast group?

What do you mean by "set to the interface" ?
On multihomed hosts, you usually need to specify which interface you want to register on. That really should be a config parameter so the administrator can configure it.

If you just want to get up and running, just use INADDR_ANY. Here's an example:
Yes It is configurable. It can let kernel to determine the interface by using INADDR_ANY. However, If I want to set it manually, I am confused what interface should I use. the local interface such eth0 or multicast address? Moreover, the port number is considered along with the address?
Then you switch on multicasting on an interface, it asks for a route to be set up for multicast group for you.

I am confused what interface should I use

struct ip_mreq takes both. You're sort of saying, I want to join the mcast group as a listener on this interface.
Topic archived. No new replies allowed.