MCPcopy Create free account
hub / github.com/DNAProject/DNA / keepOnlineService

Method keepOnlineService

p2pserver/p2pserver.go:471–484  ·  view source on GitHub ↗

keepOnline try connect lost peer

()

Source from the content-addressed store, hash-verified

469
470//keepOnline try connect lost peer
471func (this *P2PServer) keepOnlineService() {
472 t := time.NewTimer(time.Second * common.CONN_MONITOR)
473 for {
474 select {
475 case <-t.C:
476 this.retryInactivePeer()
477 t.Stop()
478 t.Reset(time.Second * common.CONN_MONITOR)
479 case <-this.quitOnline:
480 t.Stop()
481 return
482 }
483 }
484}
485
486//reqNbrList ask the peer for its neighbor list
487func (this *P2PServer) reqNbrList(p *peer.Peer) {

Callers 1

StartMethod · 0.95

Calls 3

retryInactivePeerMethod · 0.95
StopMethod · 0.65
ResetMethod · 0.45

Tested by

no test coverage detected