pings send pkgs to get pong msg from others
(peers []*peer.Peer)
| 515 | |
| 516 | //pings send pkgs to get pong msg from others |
| 517 | func (this *P2PServer) pingTo(peers []*peer.Peer) { |
| 518 | for _, p := range peers { |
| 519 | if p.GetState() == common.ESTABLISH { |
| 520 | height := this.ledger.GetCurrentBlockHeight() |
| 521 | ping := msgpack.NewPingMsg(uint64(height)) |
| 522 | go this.Send(p, ping, false) |
| 523 | } |
| 524 | } |
| 525 | } |
| 526 | |
| 527 | //timeout trace whether some peer be long time no response |
| 528 | func (this *P2PServer) timeout() { |
no test coverage detected