lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Sep 26, 2011 at 10:16, Matthew Wild <mwild1@gmail.com> wrote:
> On 26 September 2011 15:28, Thijs Schreijer <thijs@thijsschreijer.nl> wrote:
>>
>
>> Is this going to be solid? I used some code from and old post to make
>> copas handle UDP sockets. Now what will luasocket do when data comes in
>> while copas isn’t listening? (obviously the intermezzo is going to be as
>> short as possible, but still...). Will luasocket buffer the data? And for
>> UDP? I haven’t seen a possibility to set a buffersize somewhere in
>> luasocket, so when will that run out?
>>
>
> The OS will buffer the data. How much data is dependent on the OS, and
> its configuration. On Linux you can see the default buffer size with:
> cat /proc/sys/net/ipv4/udp_rmem_min
>
> If the buffer is full when a packet arrives that packet will typically
> just be discarded (with UDP).
>
> Regards,
> Matthew
>
>

Be warned as well that while UDP packets will be buffered, you can't
read only part of a buffered packet. If you only read some of the
packet, the rest gets discarded.

-- 
Sent from my toaster.