Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
26a44fcc
Commit
26a44fcc
authored
Dec 08, 2014
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dht: comment for asyncQueryBuffer
parent
93872a52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
routing/dht/routing.go
routing/dht/routing.go
+7
-1
No files found.
routing/dht/routing.go
View file @
26a44fcc
...
...
@@ -13,6 +13,12 @@ import (
u
"github.com/jbenet/go-ipfs/util"
)
// asyncQueryBuffer is the size of buffered channels in async queries. This
// buffer allows multiple queries to execute simultaneously, return their
// results and continue querying closer peers. Note that different query
// results will wait for the channel to drain.
var
asyncQueryBuffer
=
10
// This file implements the Routing interface for the IpfsDHT struct.
// Basic Put/Get
...
...
@@ -272,7 +278,7 @@ func (dht *IpfsDHT) FindPeer(ctx context.Context, id peer.ID) (peer.Peer, error)
// FindPeersConnectedToPeer searches for peers directly connected to a given peer.
func
(
dht
*
IpfsDHT
)
FindPeersConnectedToPeer
(
ctx
context
.
Context
,
id
peer
.
ID
)
(
<-
chan
peer
.
Peer
,
error
)
{
peerchan
:=
make
(
chan
peer
.
Peer
,
10
)
peerchan
:=
make
(
chan
peer
.
Peer
,
asyncQueryBuffer
)
peersSeen
:=
map
[
string
]
peer
.
Peer
{}
routeLevel
:=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment