code: func (f *freeClientPool) setLimits(count int, totalCap uint64) {
  	f.lock.Lock()
  	defer f.lock.Unlock()
  
  	f.connectedLimit = int(totalCap / f.freeClientCap)
  	if count < f.connectedLimit {
  		f.connectedLimit = count
  	}
  	now := mclock.Now()
  	for f.connPool.Size() > f.connectedLimit {
  		i := f.connPool.PopItem().(*freeClientPoolEntry)
  		f.dropClient(i, now)
  	}
  }
docs: // setConnLimit sets the maximum number of free client slots and also drops
  // some peers if necessary