Where does the socket timeout of 21000 ms come from?

后端 未结 3 1006
时光取名叫无心
时光取名叫无心 2020-12-18 13:23

The Problem

An app I\'m maintaining keeps getting socket timeouts after approximately 21000 ms, despite the fact that I\'ve explicitly set longer ti

3条回答
  •  失恋的感觉
    2020-12-18 14:21

    It seems like it is a Windows default configuration...

    https://social.technet.microsoft.com/Forums/windows/en-US/9e7f59dd-6469-4ade-91ca-ceb5bcaf2675/windows-7-tcp-parameter-tcpmaxconnectretransmissions-and-tcpinitialrtt?forum=w7itpronetworking

    Based on the link and some further reading, Windows will by default do 3 retries and double the timeout with each attempt, starting a s 3sec one. So you end up with 3sec + 6sec + 12sec = 21sec timeout.

提交回复
热议问题