lua-users home
lua-l archive

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

2 points:

1- you should avoid sending data connection parameters over a
connection (in your case a port number).  that's what makes FTP and
(even worse) SIP so hard to go over NATs.  you can have any number of
simultaneous TCP connections with the same server port number, no
contention problems there.

2- coroutines are totally synchrounous, there's no concurrent
processing there.  the upside is that you don't (usually) have any
data integrity problem, the downside is that if you block waiting for
a socket on a coroutine, the whole server stalls.

if you're not familiar with the common server structure, you can start
with one of several already available.