lua-users home
lua-l archive

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

2009/3/27 John Dunn <>:
> The goal is to allow our users to communicate with 3rd party hardware via
> UPD, TCP/IP and RS-232. Common usage might be to watch an input value, and
> if it changes, send out a value on the network and verify the result.
> [...]
> The ideal solution is to determine a way to use LuaSockets in our framework.
> Not only does this mean less development work on our end but it opens up a
> lot of communications possibilites that we likely wouldn't have. Given our
> current framework, it seems like it might be possible to use our Timer,
> coroutines and yield to cobble something together that would work with
> LuaSockets. Note the following is a mishmash of pseudocode and semi-real
> code from LuaSockets.
> [...]
> Given the complexity of the code and the unknowns, I don't think the above
> solution makes sense. Can anyone suggest another approach that would work
> with our framework?

You should have a look at Copas [1]. It's a framework that removes the
blocking aspect of LuaSocket with the help of coroutines.