Por lo general, el "tiempo de espera de conexión" se refiere al tiempo de espera para crear la conexión inicial a un host. En muchos sistemas (incluido Windows 7), este valor se configura mediante parámetros distintos de los tiempos de espera para las comunicaciones en curso una vez establecida la conexión. Esta respuesta se refiere al escenario de "conexión inicial" para Windows 7, que es diferente de XP.
En el caso de Windows 7, se necesitan dos hotfixes para poder ajustar la configuración del tiempo de espera de la conexión. Los nuevos ajustes pueden configurarse con el comando 'netsh'.
Del artículo del hotfix 2786464:
Nota En Windows 7 y Windows Server 2008 R2, el valor máximo de retransmisión SYN de TCP (JH: MaxSynRetransmissions) está establecido en 2, y no es configurable. Debido al límite de 3 segundos del valor de tiempo de espera inicial (JH: InitialRTO), el handshake TCP de tres vías está limitado a un marco de tiempo de 21 segundos (3 segundos + 2*3 segundos + 4*3 segundos = 21 segundos).
El primer hotfix añade un ajuste "MaxSynRetransmissions" que permite cambiar el ajuste de reintentos desde el valor por defecto de 2. El segundo añade el ajuste "InitialRto" que permite cambiar el valor de RTO inicial desde el valor por defecto de 3000ms (sí, milisegundos), pero sólo a algo más corto que 3000ms; no se puede aumentar. Dependiendo de tu situación, puede que sólo necesites el hotfix 'MaxSynRetransmissions'.
Instale ambos hotfixes, reinicie y abra una ventana de comandos como administrador. No se requieren más reinicios para las siguientes invocaciones de comandos netsh.
C:\Windows\system32>NET SESSION >nul 2>&1
C:\Windows\system32>IF %ERRORLEVEL% EQU 0 (ECHO Administrator PRIVILEGES Detected!) ELSE ( ECHO NOT AN ADMIN! )
Administrator PRIVILEGES Detected!
C:\Windows\system32>netsh interface tcp show global
Querying active state...
TCP Global Parameters
----------------------------------------------
Receive-Side Scaling State : enabled
Chimney Offload State : automatic
NetDMA State : enabled
Direct Cache Acess (DCA) : disabled
Receive Window Auto-Tuning Level : normal
Add-On Congestion Control Provider : none
ECN Capability : disabled
RFC 1323 Timestamps : disabled
Initial RTO : 3000
Non Sack Rtt Resiliency : disabled
Max SYN Retransmissions : 2
** The above autotuninglevel setting is the result of Windows Scaling heuristics
overriding any local/policy configuration on at least one profile.
C:\Windows\system32>cmd /v:on /c "echo !TIME! & telnet 192.168.1.254 & echo !TIME!"
14:10:30.53
Connecting To 192.168.1.254...Could not open connection to the host, on port 23: Connect failed
14:10:51.60
C:\Windows\system32>netsh interface tcp set global MaxSynRetransmissions=3
Ok.
C:\Windows\system32>netsh interface tcp show global
Querying active state...
TCP Global Parameters
----------------------------------------------
Receive-Side Scaling State : enabled
Chimney Offload State : automatic
NetDMA State : enabled
Direct Cache Acess (DCA) : disabled
Receive Window Auto-Tuning Level : normal
Add-On Congestion Control Provider : none
ECN Capability : disabled
RFC 1323 Timestamps : disabled
Initial RTO : 3000
Non Sack Rtt Resiliency : disabled
Max SYN Retransmissions : 3
** The above autotuninglevel setting is the result of Windows Scaling heuristics
overriding any local/policy configuration on at least one profile.
C:\Windows\system32>cmd /v:on /c "echo !TIME! & telnet 192.168.1.254 & echo !TIME!"
14:27:02.33
Connecting To 192.168.1.254...Could not open connection to the host, on port 23:
Connect failed
14:27:47.41
C:\Windows\system32>netsh interface tcp set global MaxSynRetransmissions=2
Ok.
C:\Windows\system32>netsh interface tcp set global InitialRto=1000
Ok.
C:\Windows\system32>netsh interface tcp show global
Querying active state...
TCP Global Parameters
----------------------------------------------
Receive-Side Scaling State : enabled
Chimney Offload State : automatic
NetDMA State : enabled
Direct Cache Acess (DCA) : disabled
Receive Window Auto-Tuning Level : normal
Add-On Congestion Control Provider : none
ECN Capability : disabled
RFC 1323 Timestamps : disabled
Initial RTO : 1000
Non Sack Rtt Resiliency : disabled
Max SYN Retransmissions : 2
** The above autotuninglevel setting is the result of Windows Scaling heuristics
overriding any local/policy configuration on at least one profile.
C:\Windows\system32>cmd /v:on /c "echo !TIME! & telnet 192.168.1.254 & echo !TIME!"
14:29:06.13
Connecting To 192.168.1.254...Could not open connection to the host, on port 23:
Connect failed
14:29:13.20
Nota: El telnet de Windows se utiliza como referencia para el tiempo de espera real de la conexión. Es necesario instalarlo por separado, pero es fácil de hacer.
Enlaces adicionales / kudos: