How to know if UDP message was received?

Blitz3D Forums/Blitz3D Programming/How to know if UDP message was received?

slenkar(Posted 2005) [#1]
How do you know if your UDP message was recieved?

If you keep sending the message until you get a confirmation message back youll have to confirm the confirm ad infinitum.

So how do you make sure the message was received?


Ross C(Posted 2005) [#2]
You would probably need a time out system of some sort. Send a unique ID with the packet. The computer that sent the packet will wait x amount of millisecs for confirmation. If it doesn't receive it, then it will resend.

If the computer receiving the packet gets two, then disregard the packet.

If your using UDP however, you'll probably be using it for a fast game, so missed packets are something the other end needs to cope with, to keep the game moving.


slenkar(Posted 2005) [#3]
How would I create unique number ID's?
I would have to send messages to other computers to tell them not to use that number and they might not get the message..

I need a reliable way of saying 'this player has fired a bullet' but TCP is far too slow for that,


Ross C(Posted 2005) [#4]
Well, each computer should start on the same number. Compare the packet number sent, to the clients count. If they don't match up you have lost a packet. Alternatly, try using one of the free libs for networking. RottNet worked well for me and it had reliable packets built in :o)


slenkar(Posted 2005) [#5]
yeh I found that on the blitz website using google but the download was down,
also blitzplay is still on the old blitzcoder site and not the new codersworkshop site,
installing a whole network library could be a pain, Knet library is also a possibility

During tests I found that 'unreliable' directplay packets were actually very reliable, 50 sends and no dropped packets


KuRiX(Posted 2005) [#6]
If you want to use UDP for your gamming perhaps you should look at other libraries (instead of in built udp sockets) like blitzplay (not anymore supported) or my new wrapper of RakNet (this rocks!)!!!


Xzider(Posted 2005) [#7]
Nah , use TCP..


slenkar(Posted 2005) [#8]
Ok Ill check out RAknet thanks,

TCP TOO SLOW-xzider


Regular K(Posted 2005) [#9]
All TCP messages are reliable, so you could somehow combine the two. Use UDP for non-relaible messages, and TCP for reliable ones.


Ross C(Posted 2005) [#10]
I believe TCP hangs though if the message isn't received... There definetly was a reason I stopped using it.


DH(Posted 2005) [#11]
Blitzplay is no longer supported?????

WTH! I just bought that about 9 months ago!

No wonder why people stay away from indie developers for tools, they never stick with stuff...


ozak(Posted 2005) [#12]
TCP does not hang. You can check the stream for data and just go on if there's none. You can easily use TCP/IP instead of UDP. You still have to do some kind of dead reckogning as both UDP and TCP/IP packets will get severely delayed over the internet :)


slenkar(Posted 2005) [#13]
the person sending the tcp message has their game hang


Ross C(Posted 2005) [#14]
thought so :o)