Search Unity

NetworkTransport.ReceiveFromHost Error

Discussion in 'Multiplayer' started by FuxyWuxy, Apr 7, 2017.

  1. FuxyWuxy

    FuxyWuxy

    Joined:
    Mar 25, 2017
    Posts:
    3
    Not sure if this is a bug or something that I am doing wrong, under normal conditions there is no problem.

    I have been running a test where the client connects and sends around 1,000 small packets to attempt to flood the server. ( Just a simple NetworkTransport.Send() loop )

    Even with the flooding everything is fine, up until I disconnect the client before all of the packets have been processed.

    Code (CSharp):
    1.         public void DisconnectUser(List<int> userList)
    2.         {
    3.             for (int i = 0; i < userList.Count; ++i)
    4.             {
    5.                 byte error;
    6.                 NetworkTransport.Disconnect(hostID, userList[i], out error);
    7.                 cDictionary.Remove(userList[i]);
    8.                 ErrorLog(error);
    9.             }
    10.         }
    No problem with the disconnection, the client even receives it, the problem arrives on the next DataEvent

    Assertion failed on expression: '0'
    UnityEngine.Networking.NetworkTransport:ReceiveFromHost(Int32, Int32&, Int32&, Byte[], Int32, Int32&, Byte&)

    I've been trying to figure this one out all day, but with no success
    Has anyone else encountered this problem? or possibly have any ideas/suggestions? :p
     
  2. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    @FuxyWuxy I do not see any error in your code, please report the bug about this
     
  3. SCLaunder

    SCLaunder

    Joined:
    Apr 12, 2016
    Posts:
    3
    @FuxyWuxy Did you create a bug for this or manage to fix it? We're running into the exact same issue (Edit - For reference I'm using Unity 5.6.2f1)
     
    Last edited: Jun 27, 2017
  4. FuxyWuxy

    FuxyWuxy

    Joined:
    Mar 25, 2017
    Posts:
    3
    @SCLaunder Yes, I have submitted this bug and was told that the developers have been notified.
     
  5. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    @FuxyWuxy could you please provide bug number? :) and please unity version. (I guess it has been already fixed with the last patch for 5.6...)
     
  6. FuxyWuxy

    FuxyWuxy

    Joined:
    Mar 25, 2017
    Posts:
    3
    @aabramychev Case: 899200 Version: 5.6.0 but was still confirmed in 5.6.1
     
  7. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    could you please try the latest patch? According my records it should be fixed in 5.6.1p2.