IsIPInInConnRecord return result whether the IP is in inConnRecordList
(ip string)
| 534 | |
| 535 | //IsIPInInConnRecord return result whether the IP is in inConnRecordList |
| 536 | func (this *NetServer) IsIPInInConnRecord(ip string) bool { |
| 537 | this.inConnRecord.RLock() |
| 538 | defer this.inConnRecord.RUnlock() |
| 539 | var ipRecord string |
| 540 | for addr := range this.inConnRecord.InConnectingAddrs { |
| 541 | ipRecord, _ = common.ParseIPAddr(addr) |
| 542 | if 0 == strings.Compare(ipRecord, ip) { |
| 543 | return true |
| 544 | } |
| 545 | } |
| 546 | return false |
| 547 | } |
| 548 | |
| 549 | //RemoveInConnRecord remove in connection from inConnRecordList |
| 550 | func (this *NetServer) RemoveFromInConnRecord(addr string) { |
nothing calls this directly
no test coverage detected