Search code examples
c#.nettcptcpclient

Why is the default value of the TCPClient's ReceiveBufferSize is 8192?


According to the MSDN docs the ReceiveBufferSize defaults to 8192.
I checked and it's not a result of a power of two which makes sense when using buffers.
Is there a special reason? Maybe due to the fact that there is some extra overhead with TCP?


Solution

  • 2 to the power of 13 is 8192. So, yes it's a power of 2.

    Also note it's also a multiple of 4096 which is incidentally the most popular virtual memory page size.