Is there a way to increase the limit of 20 multicast groups that you can join on a given socket? Is there some system setting that I am missing or is there some hard limit which cannot be exceeded?
Well, incase someone is searching for this, the following parameter exists:
Currently my install says 20, in the sources, I also see:
bits/in.h:#define IP_MAX_MEMBERSHIPS 20
I think bumping up the system parameter may be enough, else will have to patch the header as well!
EDIT: looks like bumping up the system parameter does the trick.
From Fernando Garcia over on rti:
You can reload the configuration file by using
sysctl -por by rebooting your system.
In my case, the line didn't exist, so I had to append it. Here's an example with a new limit of 75:
net.ipv4.igmp_max_memberships = 75
Note that this differs from the answer by @Nim in that it makes the change permanent, whereas changing the value in
/proc/sys/net/ipv4/max_igmp_memberships will only change the value for the current session, until log out.