p2p/net/swarm: half the timeout of dial
This commit is contained in:
parent
dec34b48e3
commit
d5a3bf1fa8
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue