We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f315d9 commit 9ff1e70Copy full SHA for 9ff1e70
p2p/protocol/ping/ping.go
@@ -20,8 +20,9 @@ import (
20
var log = logging.Logger("ping")
21
22
const (
23
- PingSize = 32
24
- pingTimeout = time.Second * 60
+ PingSize = 32
+ pingTimeout = 10 * time.Second
25
+ pingDuration = 30 * time.Second
26
27
ID = "/ipfs/ping/1.0.0"
28
@@ -52,6 +53,8 @@ func (p *PingService) PingHandler(s network.Stream) {
52
53
}
54
defer s.Scope().ReleaseMemory(PingSize)
55
56
+ s.SetDeadline(time.Now().Add(pingDuration))
57
+
58
buf := pool.Get(PingSize)
59
defer pool.Put(buf)
60
0 commit comments