I was wondering how the udp message received are stored.
In the tutorial : networking with udp, the server loop is
Code: Select all
data = udp:receivefrom()
if data then
...
end
socket.sleep(0.01)
so message are handled everytime or every 0.01 s
In my code I want to pull all messages every 0.1 second or less
and at this rate many message can have been received between 2 pull
but messages aren't stored in a stack, isn't it ?
If there is no stack, the best implementation seem to be a thread that store them in a stack ?
if there is a stack can I do
Code: Select all
data,_,_=udp:receivefrom()
while data do
data=udp:receivefrom()
end
thanks for your help