p2p/net/swarm: sync diagram explain
Juan Batiz-Benet committed
Jan 13, 2015 at 08:14 UTC
7f3a651f5de8f9fe850ca4c8c125a22b410afcfa
1 file changed
+11
p2p/net/swarm/swarm_dial.go
+11
@@ -17,6 +17,17 @@ import (
17
manet "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr-net"
18
)
19
20
+// Diagram of dial sync:
21
+//
22
+// many callers of Dial() synched w. dials many addrs results to callers
23
+// ----------------------\ dialsync use earliest /--------------
24
+// -----------------------\ |----------\ /----------------
25
+// ------------------------>------------<------- >---------<-----------------
26
+// -----------------------| \----x \----------------
27
+// ----------------------| \-----x \---------------
28
+// any may fail if no addr at end
29
+// retry dialAttempt x
30
+
31
// dialAttempts governs how many times a goroutine will try to dial a given peer.
32
const dialAttempts = 3
33