Hello!
It's the following setup:
- client and server on the same machine.
- client focused that it has 100% performance (best with vsync off)
- server in idle mode
What happens is that the server is stuttering but the client still sends around 1kb/sec.
As a result I'm getting random disconnects that I could pin down to an EndSend exception:
NullReferenceException: Object reference not set to an instance of an object
TNet.GameServer.EndSend (Boolean reliable) (at Assets/Scripts/TNet/Server/TNGameServer.cs:718)
UserCommandProcessor.FixedUpdate () (at Assets/Scripts/ArenaGank/UserCommandProcessor.cs:82)
I added some stuff so if your lines don't match:
718: mBuffer.EndTcpPacket(); // in public void EndSend(bool reliable)
and after a little while:
30.915 Process player connections nextObject reference not set to an instance of an object at TNet.GameServer.EndSend (Boolean reliable, TNet.TcpPlayer player)
[0x0005d] in C:\Users\Enzi\Documents\Unity3d\AG_Server\Assets\Scripts\TNet\Server\TNGameServer.cs:681
at TNet.GameServer.ProcessPlayerPacket (TNet.Buffer buffer, TNet.TcpPlayer player, Boolean reliable)
[0x00199] in C:\Users\Enzi\Documents\Unity3d\AG_Server\Assets\Scripts\TNet\Server\TNGameServer.cs:923
at TNet.GameServer.ThreadFunction ()
[0x00125] in C:\Users\Enzi\Documents\Unity3d\AG_Server\Assets\Scripts\TNet\Server\TNGameServer.cs:283
UnityEngine.Debug:Log(Object)
StartServer:Update() (at Assets/Scripts/AG/StartServer.cs:45)
where:
681:mBuffer.Recycle(); // in public void EndSend(bool reliable, TcpPlayer player)
923: EndSend(true, player); // in case Packet.RequestPing:
283: if (ProcessPlayerPacket(buffer, player, true))
Are you familiar with this problem? Does the buffer run out or something? Threading problem? *shiver*
As a workaround I'm setting the priority for the unity server to high. It eliminates the problem but the server will still crash under heavy load. (I guess)
Thanks in advance!