[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Asynchronous File Input with Copas
- From: Sam Roberts <vieuxtech@...>
- Date: Wed, 11 Mar 2009 10:50:33 -0700
On Wed, Mar 11, 2009 at 7:05 AM, steve donovan
> 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: