[erlang-questions] Multicast UDP sending question

Valentin Micic <>
Tue Nov 17 18:48:44 CET 2009


Let me give you a standard explanation:

{reuseaddr,true}is mapped to SO_REUSEADDR flag, which is only used when you
want to fire up something even though the port is still in a TIME_WAIT state
(if you do not have SO_REUSEADDR set, you wouldn't be able to do that).

I cannot explain how OSX does things, but I can speculate:

- One may plumb a number of logical interfaces to the same physical
interface and bound the same UDP port number to a specific interface (but
then, this is not really the same port!). Each application may use a
different logical interface to subscribe to the same multicast address,
hence receive the same packet.

- There may be a "higher level" API for multicast handling at the kernel
level. I remember that Mickeysoft Windoze had something similar, but never
really cared enough to test it... Maybe it is a similar kind of "innovation"
that Apple does so well.

V/


-----Original Message-----
From:  [mailto:] On
Behalf Of Jarrod Roberson
Sent: 17 November 2009 04:45 PM
To: Valentin Micic
Cc: Torben Hoffmann; Erlang
Subject: Re: [erlang-questions] Multicast UDP sending question

On Tue, Nov 17, 2009 at 9:15 AM, Valentin Micic
<>wrote:

>
> You cannot open the same UDP port twice (or, shall I say -- bound the same
> UDP port to two different sockets). The story about N, N+1 port as well as
> explanation indicated that this is an Erlang restriction due to the socket
> library used is - well... pure fiction.
>

thanks for the clarification. I am not sure how the Erlang internals work.
Can you explain what {reuseaddr,true} does then, if not bind the same UDP
port to multiple sockets.
There are LOTS of applications on a OSX that all bind to 224.0.0.251:5353,
is there a semantic different I am missing.
Thanks for taking the time to explain this.



More information about the erlang-questions mailing list