lidgren / lidgren-network-gen3

Lidgren Network Library
https://groups.google.com/forum/#!forum/lidgren-network-gen3
MIT License
1.19k stars 331 forks source link

Hail message inconsistency #43

Open jbruening opened 8 years ago

jbruening commented 8 years ago

I have clients connecting with a hail message, and it doesn't work sometimes.

Most clients appear to be working, but occasionally I'll get a client that simply doesn't have the hail message

Here is an example of one time that it didn't

bad hailing

If I attempt to use connection approval (turning on the message, and handling it), a similar thing will happen. Sometimes it appears that the hail message is packets from other clients, other times I'm not sure what it is.

simply reading messages like this:

var readMessages = new List<NetIncomingMessage>();
while (true)
{
  var read = _server.ReadMessages(readMessages);
  for (int i = 0; i < read; i++)
  {
    var msg = readMessages[i];
     //do stuff with the message
  }
}

This usually happens if I have other clients already connected and sending data.

jbruening commented 8 years ago

and here it is working just fine worked fine

lidgren commented 8 years ago

All pasted code is custom code so it's hard to tell if it's a library problem or local problem; and i'm not able to repro the issue...