提交 0821a5bd 作者: Juan Batiz-Benet

p2p/net/swarm: half the timeout of dial

上级 10ae01f6
......@@ -115,6 +115,9 @@ func (d *Dialer) reuseDial(laddr, raddr ma.Multiaddr) (conn net.Conn, retry bool
return nil, true, reuseport.ErrReuseFailed
}
// half the timeout so we can retry regularly if this fails.
d.Dialer.Dialer.Timeout = (d.Dialer.Dialer.Timeout / 2)
// give reuse.Dialer the manet.Dialer's Dialer.
// (wow, Dialer should've so been an interface...)
rd := reuseport.Dialer{d.Dialer.Dialer}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论