Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

UNet Client Disconnected Error: Timeout

Discussion in 'UNet' started by Woaka, Oct 1, 2015.

  1. Woaka

    Woaka

    Joined:
    Sep 28, 2015
    Posts:
    2
    First time poster here. Getting an error with the multiplayer lobby, specifically.


    I only get this error when trying to connect to a server hosted on a web player and connecting via a windows build, vice versa. However, when i'm running on the same platform, e.g. windows server and a windows client i'm able to connect, same with the web build.

    The network manager seems to find the server and even receives the server's IP address. After around a minute, the timeout error is shows itself. Absolutely no idea why a client can't connect to the server when the platform is different. Any help appreciated! Thanks in advance.


    - Woaka



    Edit:
    I managed to fix it! Upgraded unity from 5.1.2 to the latest version (5.2.1) and the timeout error no longer shows itself. Hope this helps anyone else with a similar error!
     
    Last edited: Oct 1, 2015
  2. Tim-Page

    Tim-Page

    Joined:
    Nov 23, 2015
    Posts:
    3
    I'm on 5.2.1p4, and I get the same problem on a bad wifi and in local machine testing with Network Simulation on and set to worst case (20% packet loss and 400ms latency).

    I imagine there are lots of potential issues that could result in a disconnect.

    Mine is a really minimal case...I get the disconnect about 90 seconds the listener has connected to the broadcaster. There's no sync data in my project - just events being synchronised by Cmd->Rpc calls. And it'll go wrong even when no messages are being passed (except behind the scenes).

    I tried putting in a manual heartbeat every 1s and 5s, but that didn't help. I'm glad about that, since it'd be crazy if there wasn't some kind of heartbeat built in.

    What seems to have fixed it for me is to tweak the network manager configuration (all properties only visible in debug view in the inspector). I've been quite unscientific - I changed a lot and couldn't tell you which values made the difference - but I'll leave it here in case it gives someone a new idea to try.

    Some of the timeouts were set much lower than the 400ms latency, so I moved them to 1000ms to allow time for a round trip.

    The drop thresholds were at 5%, so I set those to higher than the network simulation's 20%.

    I set Max Combined Reliable Message Count to 1, to stop it from batching messages. Since I send messages so rarely, I figured there's a possibility they just weren't getting sent!

    As I say, for me, some combination of those changes got rid of the disconnect.
     

    Attached Files:

  3. toktik

    toktik

    Joined:
    Feb 25, 2014
    Posts:
    1
    Having same issue. Getting timeout when using builded game with Unity Network Simulation. Unity version is 5.2.3f1