my question is about lua sockets, say I have a chat and I want to make a bot for that chat. But the chat has multiple rooms all on defferent servers that are calculated by a function called getServer
the connect function would look like this
function connect(room)
con = socket.tcp()
con:connect(getServer(room), port)
con:settimeout(0)
con:setoption('keepalive', true)
con:send('auth' .. room)
and the function to loop it would be
function main()
while true do
rect, r, st = socket.select({con}, nil, 0.2)
if (rect[con] ~= nil) then
resp, err, part = con:receive("*l")
if not( resp == nil) then
self.events(resp)
end
end
end
end
now when all that runs it only receives data from the first room and I dunno how to fix that