find exist peer from addr map
(addr string)
| 463 | |
| 464 | //find exist peer from addr map |
| 465 | func (this *NetServer) GetPeerFromAddr(addr string) *peer.Peer { |
| 466 | var p *peer.Peer |
| 467 | this.PeerAddrMap.RLock() |
| 468 | defer this.PeerAddrMap.RUnlock() |
| 469 | |
| 470 | p, ok := this.PeerAddress[addr] |
| 471 | if ok { |
| 472 | return p |
| 473 | } |
| 474 | return nil |
| 475 | } |
| 476 | |
| 477 | //IsNbrPeerAddr return result whether the address is under connecting |
| 478 | func (this *NetServer) IsNbrPeerAddr(addr string) bool { |
no outgoing calls