Well, you will need to keep a map of users to their connections (sockets) if you want to write a chat server (as well as sets of users for each group). If you need to send a message to all users belonging to a specific group you do something like this:
for _, user_id in ipairs(groups[group_id]) do sockets[user_id]:send(msg) end This is really indepedent of Copas, Copas will just guarantee that if one of those sends blocks the other parts server will continue working instead of blocking too. -- Fabio Mascarenhas On Tue, Dec 8, 2009 at 10:44 PM, Sergeant K. <sergeantlu...@gmail.com> wrote: > I'm only moderately new to Lua, but very new to Copas and working with > LuaSocket. I'm working on a side project that is something akin to a > chat server. However, I cannot for the life of me figure out how to > send text that's been received by the server to all or select parties > that are connected. I've searched Google and many other places and > found zilch on the subject. Can anyone provide a good, working example > on how to do this? > > _______________________________________________ > Kepler-Project mailing list > Kepler-Project@lists.luaforge.net > http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project > http://www.keplerproject.org/ > _______________________________________________ Kepler-Project mailing list Kepler-Project@lists.luaforge.net http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project http://www.keplerproject.org/