Hi,
I am running a sample program, which does the following:
1. Create a socket.
2. Bind to a multicast addr.
3. setsockopt for IP_ADD_MEMBERSHIP
4. Receive some data from the socket.
5. Close the socket.
6. Repeat step 1 to 5.
A server is running, which sends the data onto this given multicast address.
The issue is :
If multicast addr is 224.0.0.1 then this program works fine, else for any other multicast addr (224.0.0.2/3, 239.255.*.*), this program runs fine till step 5. But after closing the socket when socket is restarted,all the socket calls return success, but it gets blocked on recvfrom() call (i.e. no data is received, though data is being transmitted from the server).
Please help.
Thanks.
Hi Dhruv, I don't think this
Hi Dhruv,
I don't think this is the right way to do this. Normally you would perform steps 1, 2, 3 only once and not in a loop. So, i guess there should be a breaking condition for ur data receive or else there are other options like using a Select
Hope this helps.
-gc