UDP socket (multicast) not receiving data (Ubuntu)
c++, sockets, ubuntu
Solution
So, in the end a little system configuration and bugfixing went a long way:
a) As root, I'd had to do the following to disable the reverse packet filter: echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter + The same for ethX.
b) Add a bogus route for the ethX (route add -net 224.0.0.0. netmask 224.0.0.0 ethX)
c) Bind the socket to the to-be-joined group's IP (otherwise any subsequent socket would get all packets from all groups I joined on that particular port).
d) Set the interface member of the ip_mreq struct to the IP of the adapter we're receiving on.
And then all was fine and dandy, test runs fast & smooth (pulling 125 multicast transport streams @ around 800-900 mbit - sure this can be smarter, but still). Thanks for all the pointers.
Problem
I'm trying to set up a little test application on Linux (Ubuntu) based on some code I wrote (and that worked) for Winsock. As it stands now, it's just a little test that creates a socket (and seemingly successfully connects) only to hang eternally on recv() instead of receiving datagrams. It's a plain blocking socket. Here's how I create it: http://pastebin.com/kcCbgxbB A few further things tested: - Port is open. - Other applications are able to receive data from the multicast address successfully. So clearly I'm overlooking something. Help greatly appreciated :-)