C# Класс Squishy.Network.TrafficWatch

This class is required for Connection throtteling. When active, a thread will poll all given throttles every PollSpan. That means calculating an exact current speed of all their Connections and continue transfer of all throttled connections.
Показать файл Открыть проект

Открытые методы

Метод Описание
Add ( Throttle throttle ) : void

Adds a new Throttle.

AddDownloadThrottle ( int maxDownBps ) : Throttle

Adds and returns a new SetThrottle which will restrict the total download speed of all its connections to the given value. Initial connections of the new throttle.

AddThrottle ( int maxUpBps, int maxDownBps ) : Throttle

Adds and returns a new SetThrottle which will restrict the total download speed and upload speeds of all its connections to the given values. Initial connections of the new throttle.

AddUploadThrottle ( int maxUpBps ) : Throttle

Adds and returns a new SetThrottle which will restrict the total upload speed of all its connections to the given value. Initial connections of the new throttle.

GetThrottle ( int index ) : Throttle
Remove ( Throttle throttle ) : void

Removes the given Throttle or does nothing if its not Active.

Remove ( int index ) : void
RemoveAll ( ) : void

Removes all Throttles.

Приватные методы

Метод Описание
PollAll ( ) : void
WaitPoll ( ) : void

Описание методов

Add() публичный статический Метод

Adds a new Throttle.
public static Add ( Throttle throttle ) : void
throttle Throttle
Результат void

AddDownloadThrottle() публичный статический Метод

Adds and returns a new SetThrottle which will restrict the total download speed of all its connections to the given value. Initial connections of the new throttle.
public static AddDownloadThrottle ( int maxDownBps ) : Throttle
maxDownBps int
Результат Throttle

AddThrottle() публичный статический Метод

Adds and returns a new SetThrottle which will restrict the total download speed and upload speeds of all its connections to the given values. Initial connections of the new throttle.
public static AddThrottle ( int maxUpBps, int maxDownBps ) : Throttle
maxUpBps int
maxDownBps int
Результат Throttle

AddUploadThrottle() публичный статический Метод

Adds and returns a new SetThrottle which will restrict the total upload speed of all its connections to the given value. Initial connections of the new throttle.
public static AddUploadThrottle ( int maxUpBps ) : Throttle
maxUpBps int
Результат Throttle

GetThrottle() публичный статический Метод

public static GetThrottle ( int index ) : Throttle
index int
Результат Throttle

Remove() публичный статический Метод

Removes the given Throttle or does nothing if its not Active.
public static Remove ( Throttle throttle ) : void
throttle Throttle
Результат void

Remove() публичный статический Метод

public static Remove ( int index ) : void
index int
Результат void

RemoveAll() публичный статический Метод

Removes all Throttles.
public static RemoveAll ( ) : void
Результат void