C# 클래스 OpenMetaverse.TokenBucket

A hierarchical token bucket for bandwidth throttling. See http://en.wikipedia.org/wiki/Token_bucket for more information
파일 보기 프로젝트 열기: Virtual-Universe/Virtual-LibOMV 1 사용 예제들

공개 메소드들

메소드 설명
RemoveTokens ( int amount ) : bool

Remove a given number of tokens from the bucket

RemoveTokens ( int amount, bool &dripSucceeded ) : bool

Remove a given number of tokens from the bucket

TokenBucket ( TokenBucket parent, int maxBurst, int dripRate ) : System

Default constructor

비공개 메소드들

메소드 설명
Drip ( ) : bool

Add tokens to the bucket over time. The number of tokens added each call depends on the length of time that has passed since the last call to Drip

메소드 상세

RemoveTokens() 공개 메소드

Remove a given number of tokens from the bucket
public RemoveTokens ( int amount ) : bool
amount int Number of tokens to remove from the bucket
리턴 bool

RemoveTokens() 공개 메소드

Remove a given number of tokens from the bucket
public RemoveTokens ( int amount, bool &dripSucceeded ) : bool
amount int Number of tokens to remove from the bucket
dripSucceeded bool True if tokens were added to the bucket /// during this call, otherwise false
리턴 bool

TokenBucket() 공개 메소드

Default constructor
public TokenBucket ( TokenBucket parent, int maxBurst, int dripRate ) : System
parent TokenBucket Parent bucket if this is a child bucket, or /// null if this is a root bucket
maxBurst int Maximum size of the bucket in bytes, or /// zero if this bucket has no maximum capacity
dripRate int Rate that the bucket fills, in bytes per /// second. If zero, the bucket always remains full
리턴 System