Search Unity

Wire Internet vs Wi-Fi Internet/3G/4G. Losing packages Unity<-->AuthServer by TCP sockets. Why?

Discussion in 'Multiplayer' started by Volchok, Apr 27, 2020.

  1. Volchok

    Volchok

    Joined:
    Jul 26, 2017
    Posts:
    127
    Hello there!

    Sorry for my English!

    If I use Wi-Fi Internet, I discovered losing packages (byte data) in sending/getting byte data betweeen Unity (C#) and AuthServer (C#) [TCP Sockets]. There no losing packages in Wire Internet. I create package id and send/get Unity<-->Server packages several times (with same package id) - this saves but not always.

    Why is this happening?
    Is there guarantee of stable exchange of packages by Wi-Fi/3G/4G?
    How could I create stable exchange of packages by Wi-Fi/3G/4G also?
    Maybe I don't understand something?

    Thanks!
     
    Last edited: Apr 27, 2020
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Wifi is susceptible to environmental factors in ways wired connections simply are not. Your Wifi router is competing with other devices in the same frequency range, and there are many especially in the 2.4 GHz band, including other nearby routers. You can also get issues with your connection when passing through solid objects like walls in your building, especially for 5 GHz band.

    Some amount of packet loss is not unusual for any wireless networking tech. If using TCP these lost packets should automatically be resent by the protocol without needing you to do anything.
     
    Volchok likes this.
  3. Volchok

    Volchok

    Joined:
    Jul 26, 2017
    Posts:
    127
    ---------------------------------

    TCP must guarantee of stable exchange of packages, as I know.
    But Unity simply stops getting/sending packages and nothing happens - no errors, no messages - nothing.
    This hapens only in Wi-Fi (2.4 GHz/ 5 GHz)/3G/4G.

    ---------------------------------