lua-users home
lua-l archive

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


Diego Nehab wrote:
> Yes. There are two "timeout" mixed. I agree. But there is
> rarely enough reason to distinguish between them.
With the socket timeout, you should keep retrying, but with the other
the socket is actually closed and you better break out of the loop. I
believe...
As it is, it was puzzling me for a while why the server just stopped
getting input but kept running as if nothing had happened.

> Nevertheless, there is a bug in the forward.lua sample, I
> think. When dispatch.lua aborts the transfer, both data and
> partial will be nil. So forward.lua will try to send nil
> through bar. I think the following code would fix it:
Sadly i just stumbled to that code while trying to write my own
server... It is based on forward.lua-like loop, but my server is line
based (with skt:receive()). So the luasocket buffering is hiding the
"normal" timeouts from me (right? at least i've never seen one).

Jorge