multicast problem

Hi There,

I have an urgent problem here and need your help. How could we to make the
IGMP version fully compatible to version 2. We have used the NetXRay to
monitor the IGMP packet that send from our QNX client and and found that the
version is v2, but there is a difference between our QNX client and windows
client which is that “leaving group message” packet. In windows, the leave
group message is sent to “All Routers Group” (, but QNX send
“leaving group message” to the same IP address as the multicast IP group
address. Can we have the QNX client to send “leave group message” to “All
Routers Group”(, so that the router will know exactly the client
is leaving the group and stop forwarding the multiast packet to the client.
For our project, to leave the group is very important, because the line link
to the client has only 6M bps, and cannot afford two multicast stream, so we
have to leave one group first and join another. Althouth the router will
stop forwarding multicast stream to client after retry a few times to query
if the client is not a multicast group member anymore, but the timeout is
too long for us, sometimes it take a few minutes. And for our project, the
response time is very critical.

Our QNX client code do the following steps to join multicast group and leave
the group:

create an udp socket.
bind to a specified port.
call setsockopt to add multicast membership to join the desired multicast
start to do recv()
call setsockopt to drop multicast membership from the multicast group we’ve
close socket.

The exact codes:

struct ip_mreq req;
req.imr_multiaddr.s_addr= inet_addr(multicast_ip_str);
req.imr_interface.s_addr = INADDR_ANY;

// join
int rc = setsockopt(socket, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char
// leave
int rc = setsockopt(socket, IPPROTO_IP, IP_DROP_MEMBERSHIP, (char

We need your help and we would be appreciate that we get your response soon.

Thanks in advance!

Teresa Tao
Neon Technology