-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于 Clinet Timeout 设置无效的问题 #43
Comments
Hello @yb 感谢反馈,你是专业的! If you think this repository is helpful, please share it with friends, thanks. |
Hi @likexian 我现在使用 |
Hello @likexian, I have opened a pull request to address this issue. It is not the cleanest way to address the problem, but might help provide a quick and dirty way forward. As suggested in the PR, we may need to make additional changes to SetTimout to make this a reliable change - but those changes might cause backwards compatibility issues with some uses of the whois package. I welcome feedback and understand if this is not the direction you would like to go in! |
Hi @likexian,
我遇到了和 #37 相同的问题,经过测试和检查 whois.go 的源代码,我猜测:
SetTimeout()
只设置了c.timeout
,而c.dialer.Timeout
没有被更新,它在NewClient()
时已经被固定为 30 秒;c.dialer.Dial()
则 timeout 无效;之所以会得出这个猜测,是因为今晚我所在的网络无法连接到
whois.nic.work
这个服务器,以下为 ping 表现:然后看了一下 net 包中关于 Dialer.Timeout 的解释,好像确实与连接时的超时有关:
EDIT: 补充一个复现方法:
如此,即可复现 5 秒超时的设置并没起作用,连接
www.google.com:43
要等到 30 秒后才超时。由于这是第一次接触 go 语言,如果猜测错误,请见谅
感谢
The text was updated successfully, but these errors were encountered: