lua-users home
lua-l archive

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

On Jun 13, 2009, at 7:27 PM, Eike Decker wrote:

I am writing a tiny webserver which is now also supporting the
keepalive feature of HTTP/1.1.

In practice, I found it more convenient to handle such time out outside of Lua, i.e. using timelimit [1] or such.

For example, using tcpserver [2] and HTTP.lua [3]:

tcpserver -c 100 -qRHlOD 0 3388 timelimit 60 lua Nanoki.lua .

In other words, tcpserver will start a time limited Lua process for every new connection.

The above setup is how the online demo of Nanoki runs:

As far as select and coroutines go... such setup is of limited practical use if any of the coroutine starts doing any real work aside from waiting on the network... ymmv of course...