lua-users home
lua-l archive

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


Hi,

I wasn't too worried about that. I'm not really sure what the use case
for that parameter is, generally, but I particularly can't see why
you'd want a prefix inserted into essentially random spots in a TCP
stream!

Think about reading a line pattern in non-blocking mode,
i.e., with 0 timeout. You don't know if the line will come
in one function call or if it will be split into several
function calls. You don't know if it will fit in the buffer
or not, so you can't accumulate it there. So passing the
partial result from the previous call into the next call
makes sure that when the call finally succeeds, you have
your entire line in one place. I think it is pretty
convenient. If there is a bug on this idea, let me know and
I will fix it.

Regards,
Diego