Hey all. I have been dabbling with networking a little bit and want some to poke holes in this idea. If I have an event that is semi-critical the players receive it on time but absolutely critical that they DO receive it would a method of sending it over UDP and TCP in tandem have the benefit of getting it there as fast as possible while also sending the packet out over TCP as a backup plan? (Assuming you discard the duplicate TCP data if the UDP got there early and successfully.) Thanks!
It’s generally recommended to only use one protocol, for a couple of reasons:
- Some NATs are known to prioritize UDP or TCP over the other, which can lead to issue
- It massively complicates the architecture having to deal with two connections for each client, it means you have to NAT-punch twice for example, and need a way to group the connections somehow
In general, pick one protocol. Use UDP if you have a fast paced game with real time requirements, otherwise use TCP. If you select UDP build your own reliable message system on top of it.
Alright! I’ll just keep it simple and stick with TCP for now. Thanks!