NetworkTransport.ReceiveFromHost Error

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.

        public void DisconnectUser(List<int> userList)
        {
            for (int i = 0; i < userList.Count; ++i)
            {
                byte error;
                NetworkTransport.Disconnect(hostID, userList[i], out error);
                cDictionary.Remove(userList[i]);
                ErrorLog(error);
            }
        }

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? :stuck_out_tongue:

@FuxyWuxy I do not see any error in your code, please report the bug about this

@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)

@SCLaunder Yes, I have submitted this bug and was told that the developers have been notified.

@FuxyWuxy could you please provide bug number? :slight_smile: and please unity version. (I guess it has been already fixed with the last patch for 5.6…)

@aabramychev Case: 899200 Version: 5.6.0 but was still confirmed in 5.6.1

could you please try the latest patch? According my records it should be fixed in 5.6.1p2.