#Cannot send packet larger than ...

8 messages · Page 1 of 1 (latest)

barren harness
#

Hi!

I got the following error on my Mirror Server.

NetworkConnection.ValidatePacketSize: cannot send packet larger than 16384 bytes, was 19606 bytes
ArgumentException: GetBatch needs a fresh writer!
  at Mirror.Batcher.CopyAndReturn (Mirror.NetworkWriterPooled batch, Mirror.NetworkWriter writer) [0x00008] in <eaf938c4f3f44351b7b82e938308ff24>:0
  at Mirror.Batcher.GetBatch (Mirror.NetworkWriter writer) [0x00020] in <eaf938c4f3f44351b7b82e938308ff24>:0
  at Mirror.NetworkConnection.Update () [0x00050] in <eaf938c4f3f44351b7b82e938308ff24>:0
  at Mirror.NetworkConnectionToClient.Update () [0x0001a] in <eaf938c4f3f44351b7b82e938308ff24>:0
  at Mirror.NetworkServer.Broadcast () [0x00051] in <eaf938c4f3f44351b7b82e938308ff24>:0
  at Mirror.NetworkServer.NetworkLateUpdate () [0x0002f] in <eaf938c4f3f44351b7b82e938308ff24>:0
  at Mirror.NetworkLoop.NetworkLateUpdate () [0x00010] in <eaf938c4f3f44351b7b82e938308ff24>:0

My only clue is that there was too much data in a SyncDictionary that I am using. Does it have a limitation of how much data it can handle?

I also got this one, not sure if its related or not:

[SimpleWebTransport] EXCEPTION: SocketException Message: Too many open files
  at System.Net.Sockets.Socket.Accept () [0x00033] in <68069378c72d45228fc9d977cd8eee2c>:0
  at System.Net.Sockets.TcpListener.AcceptTcpClient () [0x0001e] in <68069378c72d45228fc9d977cd8eee2c>:0
  at Mirror.SimpleWeb.WebSocketServer.acceptLoop () [0x00071] in <2bad7af8deb2476ba0134780d93ff05a>:0

Thanks in advance.

#

Cannot send packet larger than ...

mossy narwhal
mossy narwhal
mossy narwhal
# barren harness https://pastie.io/ailinq.cs

That would only break the bank if there were hundreds of entries...perhaps you're not clearing entries when players drop out. That said, that data should be SyncVars on the players, not centralized like that. Might be able to shrink them to byte or ushort too. Ask yourself if all clients even need that data, or if it should just be the owner client, or just the server.

barren harness
# mossy narwhal That would only break the bank if there were hundreds of entries...perhaps you'r...

Indeed it had hundreds of entries.

The reason I did it this way, is to keep the data of the leaderboard, to know which player contributed which amount. That data was fethced by the Mirror server from another server (lets call it data server) that we set up. And we specifically did not want clients to connect or even know about the existence of that data server.

For future, how can I know what is the maximum capacity that can be handled by SyncDicrionary, SyncVar, SyncList, etc. ?

mossy narwhal
# barren harness Indeed it had hundreds of entries. The reason I did it this way, is to keep the...

It's going to be what you hit, which is max message size, which you can increase. Clients don't have to connect to your data source...server would get the data and put it into SyncVars of the player, each of which would in turn feed that data into the UI (and remove it when they disconnect). If you're really wanting forever historical data, then it doesn't belong on the game network - make a web service that clients can fetch the data from.