[solved] lua socket - udp protocol
Posted: Fri Jul 03, 2015 5:59 pm
I am programming a server receiving message from many clients
I was wondering how the udp message received are stored.
In the tutorial : networking with udp, the server loop is while timeout is set to 0
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 ?
thanks for your help
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