lua-users home
lua-l archive

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


On Wed, Mar 11, 2009 at 7:05 AM, steve donovan
<steve.j.donovan@gmail.com> wrote:
> Copas is a wonderful way to make little servers.  But now I want to
> add a CLI interface, and the only way I can think of is writing an
> extension which connects to a Copas server and reads stdin (or any
> file handle, e.g a pipe) in a separate thread, writing any text read
> to the server.
>
> This is awkward, and I was wondering if there isn't some socket
> science exposed by LuaSocket which can help here.

People routinely hack LuaSocket to support arbitrary fds, search this
list for Diego's advice on how to do it.

He refuses to add it to LuaSocket because it is hard to make work on
Windows, which is probably irrelevant to you.

My hack is here, though doesn't use copas:

http://github.com/sam-github/swirl/blob/af29de8aa44359569504914912010affd874da92/lua/sockext.lua

Sam