GetIpCountInInConnRecord return count of in connections with single ip
(ip string)
| 563 | |
| 564 | //GetIpCountInInConnRecord return count of in connections with single ip |
| 565 | func (this *NetServer) GetIpCountInInConnRecord(ip string) uint { |
| 566 | this.inConnRecord.RLock() |
| 567 | defer this.inConnRecord.RUnlock() |
| 568 | var count uint |
| 569 | var ipRecord string |
| 570 | for addr := range this.inConnRecord.InConnectingAddrs { |
| 571 | ipRecord, _ = common.ParseIPAddr(addr) |
| 572 | if 0 == strings.Compare(ipRecord, ip) { |
| 573 | count++ |
| 574 | } |
| 575 | } |
| 576 | return count |
| 577 | } |
| 578 | |
| 579 | //AddOutConnRecord add out connection to outConnRecord |
| 580 | func (this *NetServer) AddOutConnRecord(addr string) { |