mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-10 18:57:57 +08:00
doc(gcr/c) comment methods
This commit is contained in:
parent
770489ab2c
commit
ba119fb1f7
@ -38,6 +38,9 @@ func (p *standard) HandleStream(s inet.Stream) {
|
||||
s.Close()
|
||||
}
|
||||
|
||||
// SendMessage sends message to each remote sequentially (randomized order),
|
||||
// stopping after the first successful response. If all fail, returns the last
|
||||
// error.
|
||||
func (px *standard) SendMessage(ctx context.Context, m *dhtpb.Message) error {
|
||||
var err error
|
||||
for _, i := range rand.Perm(len(px.Remotes)) {
|
||||
@ -73,6 +76,9 @@ func (px *standard) sendMessage(ctx context.Context, m *dhtpb.Message, remote pe
|
||||
return nil
|
||||
}
|
||||
|
||||
// SendRequest sends the request to each remote sequentially (randomized order),
|
||||
// stopping after the first successful response. If all fail, returns the last
|
||||
// error.
|
||||
func (px *standard) SendRequest(ctx context.Context, m *dhtpb.Message) (*dhtpb.Message, error) {
|
||||
var err error
|
||||
for _, i := range rand.Perm(len(px.Remotes)) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user