What do 'setsockopt ADD_MEMBERSHIP' errors mean?

This message can be recieved when creating a new reader listening on a multicast group:

setsockopt(ADD_MEMBERSHIP) error 0X62

The hex code may differ across platformsEADDRINUSE is 98 on Linux, 125 on Solarischeck your system's errno.h to be sure.

RTI middleware can share receive-resources across readers, so deleting a reader doesn't necessarily drop multicast membership. If you then create a new reader listening on the same multicast group, you might see the message.  The message is benign in this case; readers should still receive data.

This error can also be returned from other causes.  If the ethernet interface has not been completely initialised, for example, this error may be returned.  This is the output of ifconfig in one such case:

% ifconfig eth0
eth0: Link encap:Ethernet HWaddr 01:02:03:04:05:06
 UP BROADCAST MULTICAST MTU:1500 Metric:1
 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000
 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

Notice there is no IP address associated with the interface. A simple call to ifconfig (or ipconfig, depending on the platform) could fix this problem.  You may want to check with your IT department for your proper parameters for th IP address, netmasks, etc.:

ifconfig eth0 inet 192.168.27.141 broadcast 192.168.27.255  netmask 255.255.255.0

  root@Digilent-Zybo-Linux-BD-v2015_4:/myapp# ifconfig eth0
eth0: Link encap:Ethernet HWaddr 01:02:03:04:05:06
  inet addr:192.168.27.141 Bcast:192.168.27.255 Mask:255.255.255.0
  UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  RX packets:6 errors:0 dropped:0 overruns:0 frame:0
  TX packets:273 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000 
  RX bytes:1352 (1.3 KiB) TX bytes:210666 (205.7 KiB)
  Interrupt:29 Base address:0xb000

 

Comments

Article was incomplete / misleading, added a non-benign case and way to verify and fix it.