3

Possible Duplicate:
Receving multiple multicast feeds on the same port - C, Linux

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 of each group (i.e. msgs received, bytes received) and all the data is getting mixed up. Does anyone know how to solved this problem? If I try to look at the sender's address, it is not the multicast address, but rather the IP of the sending machine.

I am using the following socket options:

struct ip_mreq mreq;         
mreq.imr_multiaddr.s_addr = inet_addr("224.1.2.3");         
mreq.imr_interface.s_addr = INADDR_ANY;         
setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq));

and also:

setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &reuse, sizeof(reuse));

I appreciate any help!!!

Community
  • 1
  • 1
Gigi
  • 271
  • 1
  • 4
  • 5
  • This is an exact repost of http://stackoverflow.com/questions/2741611/receving-multiple-multicast-feeds-on-the-same-port-c-linux (without the markup and tagging help from a kindly edit). Please refrain from making duplicate questions. – mbauman Apr 30 '10 at 02:53

0 Answers0