[Live-devel] Groupsock doesn't bind to Multicast Address

Sanjeev Sood sanjeev.sood at gmail.com
Tue Oct 3 12:15:45 PDT 2006


Hello Ross,

Thanks for taking time in responding to my question.

We are using Live Media library on Linux. I am not clear when you say it is
often an operating system issue. Isn't it the responsibility of the
application to bind to a pariticular address if it wants too? If a multicast
application needs to only receive traffic on a particular multicast address,
it will have to bind to that address?

Also, regarding your other comment " This is bogus, because the default
value of "ReceivingInterfaceAddr" *is* INADDR_ANY.  I.e., you'll get the
same effect as your proposed change if you don't set
"ReceivingInterfaceAddr" at all."

We are planning to set the ReceivingInterfaceAddr to our multicast address
and it does work for us. Also, this change doesn't change your default
behavior (where it is set to NULL) and thus wont break any existing
applications.

However, I did notice that after setting ReceivingInterfaceAddr to a
multicast address, ourSourceAddressForMulticast() in Groupsock.cpp is
failing with "This computer has an invalid IP address:" error. I am in the
process of debugging why this error happens. Any hints on this as well?

Once again, I appreciate your help here.

Best,
-Sanjeev
---------- Forwarded message ----------
From: Ross Finlayson <finlayson at live555.com>
To: LIVE555 Streaming Media - development & use <live-devel at ns.live555.com>
Date: Tue, 3 Oct 2006 02:55:07 -0700
Subject: Re: [Live-devel] Groupsock doesn't bind to Multicast Address


I am relatively new user to the Live Media library. In our application, we
would like to bind to a multicast address in addition to binding to the
local port number. This is so that we *only* receive packets destined for a
given* Multicast address & port* combination and prevent other datagrams
destined for that same port from being deliverd to our socket.



This is often an operating system issue.  Some OSs work the way you want;
others do not.



// change imr.imr_interface.s_addr = ReceivingInterfaceAddr; to following:



if (IN_MULTICAST(ntohl(ReceivingInterfaceAddr))) {
    // Bound to MULTICAST Address, so use INADDR_ANY as the i/f address
    imr.imr_interface.s_addr = INADDR_ANY;
  }
  else {
    // Bound to UNICAST Address, so use this address as the i/f address
    imr.imr_interface.s_addr = ReceivingInterfaceAddr;
  }



This is bogus, because the default value of "ReceivingInterfaceAddr" *is*
INADDR_ANY.  I.e., you'll get the same effect as your proposed change if you
don't set "ReceivingInterfaceAddr" at all.

-- 


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.live555.com/pipermail/live-devel/attachments/20061003/2a1e26d8/attachment.html 


More information about the live-devel mailing list