Socket buffer size in nakama unity client

When I try to get a large amount of data from the server in response to my RPC, I get the error:

InternalBufferOverflowException: Unable to read 351728 bytes into buffer (offset: 0 size: 262144). Use a larger read buffer
Nakama.Ninja.WebSockets.Internal.BinaryReaderWriter+d__0.MoveNext () (at <00000000000000000000000000000000>:0)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) (at <00000000000000000000000000000000>:0)
Nakama.Ninja.WebSockets.Internal.BinaryReaderWriter.ReadExactly (System.Int32 length, System.IO.Stream stream, System.ArraySegment`1[T] buffer, System.Threading.CancellationToken cancellationToken) (at <00000000000000000000000000000000>:0)
Nakama.Ninja.WebSockets.Internal.WebSocketFrameReader+d__0.MoveNext () (at <00000000000000000000000000000000>:0)

Can I somehow increase the socket buffer size?

Hey @l.skupkov you can configure the socket buffer size with a config.yaml mounted to your server. Please see this section: Configuration - Heroic Labs Documentation

as well as an example file: Configuration - Heroic Labs Documentation

That is, I can adjust the size of the buffer on the client using the settings on the server? Which parameter should be changed?

@l.skupkov sorry, you’re right. We don’t currently provide a way for you to customize the size of the read buffer. It is set here: nakama-dotnet/WebSocketAdapter.cs at master · heroiclabs/nakama-dotnet · GitHub

We recommend splitting your messages into smaller sizes.