LCM - Move Multicast Group to TX Initialization

19 views
Skip to first unread message

ryan morton

unread,
Mar 1, 2012, 8:13:16 PM3/1/12
to lcm-...@googlegroups.com
Hey,

So I've ran across an interesting issue with the C implementation of lcm.  If I ensure that no other LCM programs are running and run a simple program that publishes on the default url (or any url with ttl=0), the messages actually show up outside the host (as if ttl=1).  If I wireshark on the sending machine, the message are correctly getting set with ttl=0.  Now, if I have "any" program (e.g., lcm-spy) on the sending machine subscribe to "any" message on the same ip:port as the sending program, then all desired ttl=0 messages stay on the sending machine.

Upon inspection of the C code it appears that some initialization occurs only upon subscription.  I believe (at least) one of these init blocks needs to be moved/copied to the transmit initialization side (multicast group membership).  I have attached a svn diff that fixes the problem, but there may be additional initialization that is also required.

Thanks,
Ryan 

ps. Ed Olson provided some pointers on this...
multicast_tx.diff

Albert Huang

unread,
Mar 6, 2012, 1:41:47 PM3/6/12
to lcm-...@googlegroups.com
Hi Ryan,

Thanks for the patch. Would you mind opening up a new ticket on the
issue tracker? I'd like to investigate this a bit more before
committing the patch. As far I understand, IP_ADD_MEMBERSHIP is only
supposed to be relevant for sockets that will receive multicast
packets, and not for transmitting.

Albert

> --
> You received this message because you are subscribed to the Google Groups
> "Lightweight Communications and Marshalling" group.
> To post to this group, send email to lcm-...@googlegroups.com.
> To unsubscribe from this group, send email to
> lcm-users+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/lcm-users?hl=en.

Reply all
Reply to author
Forward
0 new messages