I am testing UDP again to compare.
Matthieu
I had issues with 10+ UDP requests per second with the following code :
With this code, it's working better :
It does process the UDP queue at each iteration instead of one by one.
What do you think about it ?
Matthieu
Matthieu
I had issues with 10+ UDP requests per second with the following code :
Code:
while true do
message = udpserver:receive()
-- got message from udp, send to all active clients
if message then
for id, sock in pairs(clients) do
sock:send(message .. '\r\n')
end
end
copas.step(0.1)
end
With this code, it's working better :
Code:
while true do
message = udpserver:receive()
while message do
-- got message from udp, send to all active clients
for id, sock in pairs(clients) do
sock:send(message .. '\r\n')
end
message = udpserver:receive()
end
copas.step(0.1)
end
It does process the UDP queue at each iteration instead of one by one.
What do you think about it ?
Matthieu