[erlang-questions] SO_REUSEPORT with UDP

Benoit Chesneau <>
Thu May 21 16:18:54 CEST 2015


On Thu, May 21, 2015 at 3:04 PM pablo platt <> wrote:

> Hi,
>
> How can I have multiple workers listen on the same UDP port on Linux?
> SO_REUSEADDR or SO_REUSEPORT are suggested in several places but I
> couldn't find how to use it.
>
>
In Erlang you can use the raw option to use REUSE_PORT on your platform:

https://github.com/refuge/rbeacon/blob/master/src/rbeacon.erl#L414-L425

and:

https://github.com/refuge/rbeacon/blob/master/src/rbeacon.erl#L400-L412

- benoit


> What's the difference between SO_REUSEADDR and SO_REUSEPORT?
>
> Do I just listen on the same IP/Port with gen_udp several times with the
> option {reuseaddr, true}?
> Is there an equivalent reuseport option?
>
> Thanks
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150521/e4c20b39/attachment.html>


More information about the erlang-questions mailing list