I have an application that is receiving data from multiple multicast sources on the same port. I am able to receive the data. However, I am trying to account for statistics
Use setsockopt()
and IP_PKTINFO
or IP_RECVDSTADDR
depending on your platform, assuming IPv4. This combined with recvmsg()
or WSARecvMsg()
allows you to find the source and destination address of every packet.
Unix/Linux, note FreeBSD uses IP_RECVDSTADDR
whilst both support IP6_PKTINFO
for IPv6.
Windows, also has IP_ORIGINAL_ARRIVAL_IF