// impact of a few bad apples. 4s loses 1% of successful handshakes that
// are obtained with 60s timeout, and 5% of unsuccessful handshakes.
HandshakesTimeout time.Duration
+ // How long between writes before sending a keep alive message on a peer connection that we want
+ // to maintain.
+ KeepAliveTimeout time.Duration
// The IP addresses as our peers should see them. May differ from the
// local interfaces due to NAT or other network configurations.
TorrentPeersHighWater: 500,
TorrentPeersLowWater: 50,
HandshakesTimeout: 4 * time.Second,
+ KeepAliveTimeout: time.Minute,
DhtStartingNodes: func(network string) dht.StartingNodesGetter {
return func() ([]dht.Addr, error) { return dht.GlobalBootstrapAddrs(network) }
},
import (
"testing"
+ "time"
)
func TestingConfig(t testing.TB) *ClientConfig {
cfg.NoDefaultPortForwarding = true
cfg.DisableAcceptRateLimiting = true
cfg.ListenPort = 0
+ cfg.KeepAliveTimeout = time.Microsecond
//cfg.Debug = true
//cfg.Logger = cfg.Logger.WithText(func(m log.Msg) string {
// t := m.Text()