Skip to content

Instantly share code, notes, and snippets.

@ewxrjk

ewxrjk/connect.slow.txt

Last active Jan 15, 2020
Embed
What would you like to do?
connect errors are slow on windows
# 1s delay connecting to something that isn't listening:
richard@tsais MINGW64 ~/src/gosrc (master)
$ time plink -v -P 3000 wampoon
Connecting to 172.17.207.76 port 3000
We claim version: SSH-2.0-PuTTY_Release_0.70
Failed to connect to 172.17.207.76: Network error: Connection refused
Network error: Connection refused
FATAL ERROR: Network error: Connection refused
real 0m1.085s
user 0m0.000s
sys 0m0.015s
# tcpdump looks like this:
21:58:06.409777 IP tsais.anjou.terraraq.org.uk.55984 > wampoon.anjou.terraraq.org.uk.3000: Flags [S], seq 1126833571, win 64240, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
21:58:06.409813 IP wampoon.anjou.terraraq.org.uk.3000 > tsais.anjou.terraraq.org.uk.55984: Flags [R.], seq 0, ack 1126833572, win 0, length 0
21:58:06.912167 IP tsais.anjou.terraraq.org.uk.55984 > wampoon.anjou.terraraq.org.uk.3000: Flags [S], seq 1126833571, win 64240, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
21:58:06.912221 IP wampoon.anjou.terraraq.org.uk.3000 > tsais.anjou.terraraq.org.uk.55984: Flags [R.], seq 0, ack 1, win 0, length 0
21:58:07.411944 IP tsais.anjou.terraraq.org.uk.55984 > wampoon.anjou.terraraq.org.uk.3000: Flags [S], seq 1126833571, win 64240, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
21:58:07.411992 IP wampoon.anjou.terraraq.org.uk.3000 > tsais.anjou.terraraq.org.uk.55984: Flags [R.], seq 0, ack 1, win 0, length 0
# 2s delay trying to connect to both loopback addresses when nothing is listening.
# Windows apparently doesn't believe its own RST bits never mind anyone else's.
richard@tsais MINGW64 ~/src/gosrc (master)
$ time plink -v -P 3000 localhost
Connecting to ::1 port 3000
We claim version: SSH-2.0-PuTTY_Release_0.70
Failed to connect to ::1: Network error: Connection refused
Connecting to 127.0.0.1 port 3000
Failed to connect to 127.0.0.1: Network error: Connection refused
Network error: Connection refused
FATAL ERROR: Network error: Connection refused
real 0m2.075s
user 0m0.000s
sys 0m0.031s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment