2

For performance purpose we can set tcp stack buffer to 0 :

C# get max value for Socket.ReceiveBufferSize and Socket.SendBufferSize on a system

I guess there is also a buffer on the network card ? Is it possible to setup its size ? (In order to avoid losing data)

Community
  • 1
  • 1
Guillaume Paris
  • 10,303
  • 14
  • 70
  • 145
  • Setting its size to zero doesn't have any effect on losing data. What is the actual problem you're trying to solve? – user207421 Sep 10 '15 at 08:38
  • Is there a consequence at the server level, I mean, if a client doesn't consume data fast enough, particularly if the tcp stack buffze is set to 0, is the server's send method will tend to take more time (in case of a synchronous socket) ? – Guillaume Paris Sep 10 '15 at 09:02
  • "Is there a consequence at the server level, I mean, if a client doesn't consume data fast enough, particularly if the tcp stack buffze is set to 0" Yes there will be, as the TCP window size of the receiver will quickly go to zero, causing the sender to stop emitting waiting for a TCP window update. – jbm Sep 10 '15 at 09:22
  • "is the server's send method will tend to take more time (in case of a synchronous socket)" ...you'll put more load on the sender's TCP implementation (at the OS level), as it will have to buffer more data waiting for the TCP window to be non-zero at the receiver side. – jbm Sep 10 '15 at 09:24
  • In the case of an asynchronous send at the server level, and for instance two client connected to the server with one having its tcp stack buffet set to 0: is the client having its tcp stack set to 0 will negatively interact with the second one in term of performance and latency ? – Guillaume Paris Sep 10 '15 at 09:28

0 Answers0