```go
port := 20000
LocalAddress := "192.168.1.148"
for port<30000 {
log.Println("Starting:",port)
localAddr,_ := net.ResolveTCPAddr("tcp",LocalAddress+":"+strconv.Itoa(port))
dialer := &net.Dialer{LocalAddr: localAddr}
log.Println("Starting dial ...")
//卡在这里
conn,err := tls.DialWithDialer(dialer,"tcp","rhel:8000",tlsConfig)
log.Println("End dial ...")
if err!=nil {
log.Panicln(err)
}
go handleConn(conn)
port++
}
```
发起大约五千个连接之后,就开始卡住,之后每次DialWithDialer都要花费7min
不知道什么原因
有疑问加站长微信联系(非本文作者)