[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: more questions on co-routines and luasocket
- From: HyperHacker <hyperhacker@...>
- Date: Mon, 26 Sep 2011 12:01:43 -0600
On Mon, Sep 26, 2011 at 10:16, Matthew Wild <email@example.com> wrote:
> On 26 September 2011 15:28, Thijs Schreijer <firstname.lastname@example.org> 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).
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.