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

Joakim Plate elupus
Thu Oct 16 16:19:24 CEST 2008

Joakim Plate <elupus <at> ecce.se> writes:

> Why not just try to bind to the multicast address if that fails bind to any? 
> suspect winsock filters incoming data based on the multicast groups the said 
> socket is said to have a membership in.
> Joakim

Sadly it seems winsock is quite broken for this situation.. Found this tidbit 
on msdn.

The memberships associated with a socket do not necessarily determine which 
datagrams are received by that socket. Incoming multicast packets are accepted 
by the kernel IP layer if any socket has claimed a membership in the 
destination group of the datagram; however, delivery of a multicast datagram 
to a particular socket is based on the destination port (or protocol type, for 
raw sockets), just as with unicast datagrams. To receive multicast datagrams 
sent to a particular port, it is necessary to bind to that local port, leaving 
the local address unspecified (that is, INADDR_ANY). 


More information about the ffmpeg-devel mailing list