Пример #1
0
    def toldBandwidth(self, bandwidth):
        fi.logmsg(self.__class__, "Told %dkbps" % bandwidth)

        ThrottleApplication.throttle(
            ((fi.throttle.VPN_SERVER_IP, bandwidth),)
        )
                
        self.gotRoot(self.root)
Пример #2
0
 def update(cls):
     # Schedule
     credits = []
     
     for client in fi.throttle.model.Client.query.all():
         credits.append((client.vpn_ip, client.credit))
 
     allocations = ThrottleApplication.schedule(credits)
  
     # Update memory
     fi.throttle.model.Client.allocate(allocations)
     
     # Perform network throttling
     ThrottleApplication.throttle(allocations)
     
     fi.callLater(cls.update)
Пример #3
0
 def gotRoot(self, root):
     self.root = root
     # Start once pathloading to server
     ThrottleApplication.pathloadSend()
     
     fi.callLater(self.askBandwidth)