<div dir="ltr"><div>{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.<br></div>{active, X} refers to number of UDP packets that are immediately sent to Erlang process instead of being read into an internal buffer.<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-07 14:04 GMT+03:00 Frank Muller <span dir="ltr"><<a href="mailto:frank.muller.erl@gmail.com" target="_blank">frank.muller.erl@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span style="font-family:UICTFontTextStyleBody;font-size:17px">Hi guys,</span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px"></span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px">Can someone explain me the semantic behind {read_packets, Integer} for UDP:</span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px"><a href="http://erlang.org/doc/man/inet.html" dir="ltr" target="_blank">http://erlang.org/doc/man/<wbr>inet.html</a></span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px"></span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px">I understand the associated doc, but what i can’t get is how this option affects me if i set it for example with:</span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px">1. {read_packets, 20} + {active, once}</span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px">2. {read_packets, 20} + {active, 100}</span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px"></span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px">How many packets my process will receive in each case?</span><div><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px">And are these packets send as multiple messages one packet at a time, or as one message representing a list of N packets?</span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px"></span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px">Thank you</span><span class="HOEnZb"><font color="#888888"><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px">/Frank</span></font></span></div>
<br>______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>