TehGimp/KerbalMultiPlayer — pull request #530 by godarklight (2013-12-27 12:55:51+00:00)
Title: Implement message queueing priorities. Should fix #517, and possibly all...

... of the player list disappearing bugs. There are *heaps* of the same bug closed on the issue tracker. Search for "player list".

I haven't been able to test this across a network link yet. I added "Console.WriteLine" messages before committing to test this and it spammed "Dequeueing Low Priority message", along with the occasional "Dequeueing High Priority message" so the code works.

Hopefully I have managed to separate the low priority/high priority messages properly. https://github.com/godarklight/KerbalMultiPlayer/blob/message-queueing/KMPServer/Client.cs#L474-L480

The only one disadvantage of this method is that it's now limited to sending 1 message per 10 milliseconds (100 messages/sec). I could probably use the asyncSend callback back to the sendOutgoingMessages thing again...

Also, whoever implemented that send buffer may have been on drugs. I can't think of a valid reason to use a send buffer - Just turn tcp no delay off if you want that option. The only thing I can see it doing is creating less async callback events.