0

The ClientWebSocketOptions class in dotnet provides options to the ClientWebSocket, and has a method SetBuffer to set the internal send/receive buffer size.

What is an appropriate value for this? Apparently the max value in .net framework for this is 64kb, while dotnet core and up has no upper limit. Is 64kb adequate? It seems fairly small, but I'm not sure. The documentation doesn't give any info on appropriate values.

Jan Korf
  • 58
  • 10
  • well, how big are the payloads you are communicating? – Marc Gravell Jun 08 '21 at 11:00
  • Depends, it will be used to listen to updates from cryptocurrency exchanges, which will be sending json data ranging from a simple json value to a couple thousands of lines. The goal would be to select a value which fits a whole message? Is there a particulair downside to selecting a too big buffer size? – Jan Korf Jun 08 '21 at 11:04
  • increased memory usage :/ – Marc Gravell Jun 08 '21 at 11:18
  • Fair enough. So basically it should be set to the largest size you're expecting to receive. And send buffer? According to this it isn't used? https://github.com/dotnet/runtime/issues/43559#issuecomment-711097570 – Jan Korf Jun 08 '21 at 11:58

0 Answers0