[erlang-questions] inets {read_packets,N} option

Alex S. alex0player@REDACTED
Sat Jan 7 22:17:10 CET 2017


{read_packets, X} refers to number of UDP packets that are read whenever
the socket is notified "ready". So if 100 UDP packets arrive at the same
time, only 5 will be read until a new one arrives. There isn't really a way
to know how many dgrams are waiting on a socket, so that's an anti-flood
option.
{active, X} refers to number of UDP packets that are immediately sent to
Erlang process instead of being read into an internal buffer.

2017-01-07 14:04 GMT+03:00 Frank Muller <frank.muller.erl@REDACTED>:

> Hi guys,
>
> Can someone explain me the semantic behind {read_packets, Integer} for UDP:
> http://erlang.org/doc/man/inet.html
>
> I understand the associated doc, but what i can’t get is how this option
> affects me if i set it for example with:
> 1. {read_packets, 20} + {active, once}
> 2. {read_packets, 20} + {active, 100}
>
> How many packets my process will receive in each case?
>
> And are these packets send as multiple messages one packet at a time, or
> as one message representing a list of N packets?
>
> Thank you
> /Frank
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170108/0d8ba783/attachment.htm>


More information about the erlang-questions mailing list