Forum

> > Off Topic > UDP Packet manager (suggestions)
Forums overviewOff Topic overviewLog in to reply

English UDP Packet manager (suggestions)

4 replies
To the start Previous 1 Next To the start

old UDP Packet manager (suggestions)

Starkkz
Moderator Off Offline

Quote
Hello, I've been trying to find a decent UDP packet manager (possibly pseudocode) to write my own code in Lua. But I haven't found any examples anywhere, I wrote a 251 lines code which I'm not sure that would work. So I'm opening this thread to receive suggestions for it or either to know if there are better UDP packet managers I could get for free. If anyone is expert on this topic, I'd appreciate your answer.

This is the code I wrote:
http://pastebin.com/LYX6YzA5

My method
• I assign a ID of the current packet that is being read on every address that is connected to the UDP packet manager
• If I receive a packet whose ID is the current packet count + 1 then my code will read this packet, otherwise it will be added into a queue.

The general problem I'm having is that as there are more in coming packets from different IP addresses, the Lua script needs to make more tables for each address and I can't know when to remove each table (in other words, when they have disconnected).

Is there any better way to sort the received packets from different addresses?
edited 1×, last 08.12.14 01:11:37 am
To the start Previous 1 Next To the start
Log in to replyOff Topic overviewForums overview