lua-users home
lua-l archive

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

I want to write a client/server application. I must use Win/XP on the client
side; I'd like to initially release the server side on Win and hopefully
move to Linux in the future. The client side will use a GUI to collect some
numbers. For academic purposes, let's suppose these numbers are for three
kinds of fruit: number in stock and number sold. The client communicates
these numbers back to the server via sockets.

The server design is my real question. How's this? The Lua server program
listens on a particular port. When a client sends a request to the server,
the server responds with a different port number for the client to use, and
creates (a coroutine?) a task to listen/talk on this port. This way as many
coroutines as necessary can be started. I understand that usually there
would be an upper limit. These coroutines are separately written Lua
routines that communicate over this port number. When the coroutine has
received all the necessary data, does it send this data back to the original
Lua program so that there is no file contention and data integrity is

Thanks for any advice.