I found recently that if I have a dial-up connection (this is for a kiosk) and a local area network connection, when the dial-up connection is established (with internet acc
Use GetAdaptersAddresses() to enumerate all available interface IP addresses.
IP_MULTICAST_IF
is for IPv4 addresses only. It expects you to pass a DWORD
value containing the desired IPv4 address (in network byte order) to setsockopt()
, eg:
DWORD dwIP = ...;
setsockopt(sock, IPPROTO_IP, IP_MULTICAST_IF, (char *)&dwIP, sizeof(dwIP));