[erlang-questions] UDP concurrent server

Benoit Chesneau bchesneau@REDACTED
Wed Dec 9 13:23:15 CET 2015


On Wed, Dec 9, 2015 at 1:11 PM Sergej Jurečko <sergej.jurecko@REDACTED>
wrote:

> On Wed, Dec 9, 2015 at 12:59 PM, Benoit Chesneau <bchesneau@REDACTED>
> wrote:
>
>>
>> You can if you tell to the udp socket to reuse the port:
>> https://github.com/refuge/rbeacon/blob/master/src/rbeacon.erl#L414-L425
>>
>> If you do this any process will be able to reuse it and send/recv to it.
>>
>>
> This enables you to call gen_udp:open for port X from multiple processes.
> Unfortunately as long as first socket is alive, all traffic will go there.
> So it's just a reliability improvement (if first process goes down), but
> not a scalability improvement.
>
>
Well it would allows you to open different socket for the same ports for
recv. Normally the threads should compete to get the data according to

https://lwn.net/Articles/542629/

So until a process is on another thread or CPU it should increase the
concurrency.

- benoît
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20151209/3ac09018/attachment.htm>


More information about the erlang-questions mailing list