Any reliable UDP network libraries available for PB?
Any reliable UDP network libraries available for PB?
Hey all, has anyone developed or created a wrapper for any UDP network layers that feature reliable packets?
▓▓▓▓▓▒▒▒▒▒░░░░░
Re: Any reliable UDP network libraries available for PB?
UDP is not reliable. it's one way....Nituvious wrote:Hey all, has anyone developed or created a wrapper for any UDP network layers that feature reliable packets?
I wrote syslog server reading udp; I don't think you need any special 'wrappers'.
Re: Any reliable UDP network libraries available for PB?
You can write a routine to keep track of all packets and require acknowledgement of their arrival. I am just wondering if there are any libraries that already do this or even a wrapper of such a library.jassing wrote:UDP is not reliable. it's one way....Nituvious wrote:Hey all, has anyone developed or created a wrapper for any UDP network layers that feature reliable packets?
I wrote syslog server reading udp; I don't think you need any special 'wrappers'.
▓▓▓▓▓▒▒▒▒▒░░░░░
Re: Any reliable UDP network libraries available for PB?
Question to any PB guru: if I were to store client id as a map, would this make it faster or slower than an array or list to access and modify?
For example, which would be faster?
For example, which would be faster?
Code: Select all
Structure ms
active.b
somedata.b
EndStructure
Structure fs
id.l
somedata.b
EndStructure
NewMap mymap.ms()
Dim myarray.fs(5)
clientid = 33834
myarray(3)\id = clientid
mymap(Str(clientid))\active = 1
mymap(Str(clientid))\somedata = 34
If mymap(Str(clientid))\active = 1 ; check if client is valid
Debug mymap(Str(clientid))\somedata
EndIf
For i = 0 To ArraySize(myarray())
If (myarray(i)\id = clientid)
Debug myarray(i)\somedata
Break
EndIf
Next i▓▓▓▓▓▒▒▒▒▒░░░░░
Re: Any reliable UDP network libraries available for PB?
I'm no guru -- but it be simple enough to do a few things in a loop and time each method to see which is fastest.
However, I suspect all will be similar; and any edge may be lost on another system with different specs.
However, I suspect all will be similar; and any edge may be lost on another system with different specs.
Re: Any reliable UDP network libraries available for PB?
Which defeats the purpose of UDP. UDP is only faster than TCP because it isnt reliable. If you add reliability you end up with the same speed as TCP, maybe even slower depending on your implementation.Nituvious wrote:You can write a routine to keep track of all packets and require acknowledgement of their arrival. I am just wondering if there are any libraries that already do this or even a wrapper of such a library.jassing wrote:UDP is not reliable. it's one way....Nituvious wrote:Hey all, has anyone developed or created a wrapper for any UDP network layers that feature reliable packets?
I wrote syslog server reading udp; I don't think you need any special 'wrappers'.
If you need reliability go with TCP.
Re: Any reliable UDP network libraries available for PB?
Sending a packet and keeping a record of it does not slow down UDP. Stopping everything when a packet is lost does, this is why I do not want to use TCP.
▓▓▓▓▓▒▒▒▒▒░░░░░
Re: Any reliable UDP network libraries available for PB?
But that still doesnt change reliability. You have to send back a answer befor you go on with the program, else you dont know if a packet was lost or corrupted. Even worse they could come in in the wrong order. Just logging what packets come in does not change reliability.Nituvious wrote:Sending a packet and keeping a record of it does not slow down UDP. Stopping everything when a packet is lost does, this is why I do not want to use TCP.
UDP should be used if it is no problem if packets get missing. Like for player position updates in a game. Doesnt matter if one of the updates gets lost.
