javaudpkryo

How do I run a Kryonet server, only on one protocol?


I'm currently planning to use the Java networking library, Kryonet, for my game. I'm going to use the UDP protocol, as it is faster than TCP. I like the Kryonet API, its very clean code, however it appears to only allow running of servers, on both TCP and UDP, when I only want a server running on UDP.


Solution

  • I don't think you should make the assumption that UDP is "faster" than TCP. TCP SACK and NACK packets allow for faster retransmission requests than the older TCP sliding-window-only system, and the Explicit Congestion Notification enhancement makes it far easier for peers to communicate at a speed approaching the maximum the network can handle. (UDP would continue sending data oblivious to the congestion that leads to dropped packets.)

    Test the bandwidth, latency, and packetloss between several intended peers and see which one performs better. I'll bet it comes out nearly the same.