[FFmpeg-devel] UDP multicasts mixed up on receive due to wrong bind()

Luca Abeni lucabe72
Wed Oct 15 00:22:54 CEST 2008

Hi Laurent,

Laurent wrote:
> Hi,
> Basically, using the same socket port for 2 applications is not a good
> idea, as the port is what identifies the application within a host.
> This would be obvious if you try to do the same test with unicast
> instead of multicast.

Well, I believe that the application is identified by the
(destination address, port) pair. So, in the unicast case using the
same port for different streams does not make sense (but I've seen
things like this in the past...), but in the multicast case it can
make sense. If the two streams are generated by different nodes,
they might have no way to know if a port is already used by someone
else (on a different multicast group).

BTW, when a host has multiple unicast addresses, different applications
can receive different streams on the same port, if they are directed
to different destination addresses.

> Nevertheless, the demultiplexing of UDP packets to sockets is done
> using the port, and also the destination address (the multicast
> address, for instance). Thanks to that, binding to the multicast
> address solves the current problem, on Linux, at least.
Uhm... So, there is no standard way for an application to say
"I want to receive data from port P on multicast group MC", or
things like this?


More information about the ffmpeg-devel mailing list