Skip to content

Commit

Permalink
Merge pull request #40 from libp2p/fix/dial-timeout
Browse files Browse the repository at this point in the history
don't pass the dial timeout option
  • Loading branch information
Stebalien authored Nov 14, 2017
2 parents 6b32365 + 4381ea2 commit cae7710
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions p2p/net/swarm/swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func NewSwarmWithProtector(ctx context.Context, listenAddrs []ma.Multiaddr, loca
local: local,
peers: peers,
ctx: ctx,
dialT: DialTimeout,
dialT: conn.DialTimeout,
notifs: make(map[inet.Notifiee]ps.Notifiee),
transports: []transport.Transport{
tcpt.NewTCPTransport(),
Expand Down Expand Up @@ -164,7 +164,7 @@ func NewBlankSwarm(ctx context.Context, id peer.ID, privkey ci.PrivKey, pstpt ps
local: id,
peers: pstore.NewPeerstore(),
ctx: ctx,
dialT: DialTimeout,
dialT: conn.DialTimeout,
notifs: make(map[inet.Notifiee]ps.Notifiee),
fdRateLimit: make(chan struct{}, concurrentFdDials),
Filters: filter.NewFilters(),
Expand Down
5 changes: 0 additions & 5 deletions p2p/net/swarm/swarm_dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ const concurrentFdDials = 160
// number of concurrent outbound dials to make per peer
const defaultPerPeerRateLimit = 8

// DialTimeout is the amount of time each dial attempt has. We can think about making
// this larger down the road, or putting more granular timeouts (i.e. within each
// subcomponent of Dial)
var DialTimeout = time.Second * 10

// dialbackoff is a struct used to avoid over-dialing the same, dead peers.
// Whenever we totally time out on a peer (all three attempts), we add them
// to dialbackoff. Then, whenevers goroutines would _wait_ (dialsync), they
Expand Down
2 changes: 1 addition & 1 deletion p2p/net/swarm/swarm_listen.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (s *Swarm) AddListenAddr(a ma.Multiaddr) error {
return fmt.Errorf("no transport for address: %s", a)
}

d, err := tpt.Dialer(a, transport.TimeoutOpt(DialTimeout), transport.ReusePorts)
d, err := tpt.Dialer(a, transport.ReusePorts)
if err != nil {
return err
}
Expand Down

0 comments on commit cae7710

Please sign in to comment.