I am new to websockets and am developing an application to run on an IIS server with connection to a Windows Forms client. The message-oriented app (read as byte streams) will have a mix of message sizes, from less than 1k to a max of 64k. It will also have varying frequency of messages, with the potential for long idle periods between messages.
It appears that the "best" approach for framing is to specify a buffer size of 64k, but there doesn't seem to be a way to unallocate the buffer after handling the message. Is the same buffer used for multiple messages as long as the connection remains open? The Microsoft documentation seems a bit fuzzy here.
If there are a large number of connections, but a high percentage have long idle times between messages, is there a better way to scale?