Overview
Copas is a dispatcher based on coroutines that can be used by TCP/IP socket request/response servers. It uses LuaSocket as the interface with the TCP/IP stack.
A server registered with Copas should provide a handler for requests and use Copas socket functions to send the response. Copas loops through requests and invokes the corresponding handlers.
Copas follows the package proposal for Lua 5.1, therefore this package should be "installed". In other words, if you are using Lua 5.0, the file compat-5.1.lua must be installed in the LUA_PATH. If you are using Lua 5.1, nothing should be done.
Since Copas is coroutine based, using it within a pcall or xpcall context does not work with Lua 5.0 yielding. If you need to use those functions we strongly suggest using Xavante's coxpcall, a coroutine safe version of the Lua 5.0 protected calls.
Copas is free software and uses the same license as Lua 5.0.
Status
Current version is 1.0. It was developed for Lua 5.0 and Lua 5.1.
Download
Copas can be downloaded from its LuaForge page.
CVS access is also available from LuaForge.
History
- [17/May/2005] Version 1.0 released
Copas.step() added - [17/Feb/2005] Version 1.0 Beta released
First public version
Credits
Copas was designed and implemented by André Carregal and Javier Guerra as part of the Kepler Project which holds its copyright. Copas development had significative contributions from Diego Nehab, Mike Pall and David Burgess
Contact us
For more information please contact us. Comments are welcome!