print # of retry when sending packet via socket

Signed-off-by: Leo Chen <leo@harmony.one>
pull/106/head
Leo Chen 6 years ago
parent 63052d81eb
commit 1d7baff8c4
  1. 3
      p2p/peer.go

@ -135,6 +135,9 @@ func send(ip, port string, message []byte) {
for trial := 0; trial < 10; trial++ { for trial := 0; trial < 10; trial++ {
err := sendWithSocketClient(ip, port, message) err := sendWithSocketClient(ip, port, message)
if err == nil { if err == nil {
if trial > 0 {
log.Warn("retry sendWithSocketClient", "rety", trial)
}
return return
} }
log.Info("sleeping before trying to send again", log.Info("sleeping before trying to send again",

Loading…
Cancel
Save