I'm using the lua socket library to communicate to a multicast group. The problem I'm having is whenever a host sends a packet to the group, the socket that's listening to that group will receive its own traffic.
At first, I figured all I would need to do is, after sending a packet for the first time, is grab the address:port via udpSocket:getsocketname()
and compare that with udpSocket:receivefrom()
and don't handle messages that match. However, these don't match at all. :getsocketname()
will report "0.0.0.0" as the ip, and the ip that comes from :receivefrom()
is my actual ip ("something.not.all.zeroes").
I don't know a good way to handle this other than try and send some data along with each packet that can uniquely identify it, and don't handle the packets that originate from the same host.