[erlang-questions] inets {read_packets,N} option
Frank Muller
frank.muller.erl@REDACTED
Sat Jan 7 22:39:06 CET 2017
Hi Alex
Still didn't get it. In your example 100 UDP packets arrive so the socket's
ready for reading. Then, N=5 are read out of 100.
Why you said 5 will be read until new one arrives?
There's still 95 ready for reading right away after delivering the first 5.
I'm right?
Thank you.
/Frank
Le sam. 7 janv. 2017 à 22:17, Alex S. <alex0player@REDACTED> a écrit :
> {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/20170107/686a34c4/attachment.htm>
More information about the erlang-questions
mailing list