Author Topic: Effect of TCP (Send slow) with missed packets  (Read 3044 times)

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
Effect of TCP (Send slow) with missed packets
« on: February 01, 2015, 02:33:57 PM »
Reading up on network protocols, I learn that if TCP misses a packet, everything is held up until that's resolved, which can result in a 1000 ms interrupt. Whereas UDP has a chance of not arriving. For something like a spell cast that has to be received, TCP seems the obvious choice, but is there the possibility of a sudden lag spike that has to be factored into the engine to hide it? Notably, only activating the spell on every machine when it's arrived on all of them. Presumably this wouldn't stop UDP, so UDP position updates can proceed as normal?

Or could one use a repeated UDP request, something like sending the spell notification three times at intervals and, on the client, only activating it the once and ignoring duplicate requests?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Effect of TCP (Send slow) with missed packets
« Reply #1 on: February 02, 2015, 01:49:22 AM »
In theory, when a TCP packet is lost, the communication pauses while the packet is resent. In practice this happens once in a blue moon with today's networks. Even so, when the packet gets lost, it will simply wait for the packet to be resent, which just doubles your ping for the duration of that process. So if your ping to the server is 150 ms, you will notice a brief 300 ms spike, if you'll notice it at all.