I do understand all of that already and I figured that much, but I have no idea where in the LuaSocket module exactly where the users who connect are stored. What table? How would I list everything in the table so I can dissect it? Let's say I'm using Copas and I have three users who connect to a very simple "chat" type of environment. There are no rooms, no special protocols. It's as simple as an echo server. My question is where all of these users are stored and how does Copas/LuaSocket know which user to send data to? That's what I'm looking for. If I knew this then writing the rest would be a relative breeze.
On Thu, Dec 10, 2009 at 11:29 AM, Fabio Mascarenhas <mascaren...@acm.org> wrote: > That is a matter for your chat protocol. Usually the first thing the > client does after it connects is to identify itself, as soon as he > does it you can add it to the global users->sockets map. When he joins > a group you add it to that groups map, etc. After the user identifies > itself you can also keep a reverse sockets->users map, too, remember > that in Lua a table key can be anything, not just a string or number. > > -- > Fabio Mascarenhas _______________________________________________ Kepler-Project mailing list Kepler-Project@lists.luaforge.net http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project http://www.keplerproject.org/