C# 클래스 TransportService.PeerQueue

Class representing the queue of peer recognized as senders of a particular resource. It works to allow to balance load over peer while chosing every time the best peer to request to. This class is strictly connected to its foundamentals elements represented by theclass PeerQueueElement.
파일 보기 프로젝트 열기: zencoders/sambatyon 1 사용 예제들

공개 메소드들

메소드 설명
GetBestPeer ( ) : string

Method used to get the best sender peer at the moment of the call. The best peer of the queue is the FREE peer that has the lesser score. This method is blocking until there are no FREE peer into the network.

PeerQueue ( ) : System

Default constructor of the class.

PeerQueue ( float>.Dictionary peerQueue ) : System

Constructor of the class used to actively insert a certain number of peer inside the queue.

ResetPeer ( string key, int newScore ) : void

Method used to reset the state of a single peer into the queue. It sets the new score (as passed) of the peer indicated.

this ( string key ) : PeerQueueElement

Operator overload of the operator square brackets. It directly refers to the inner dictionary.

메소드 상세

GetBestPeer() 공개 메소드

Method used to get the best sender peer at the moment of the call. The best peer of the queue is the FREE peer that has the lesser score. This method is blocking until there are no FREE peer into the network.
public GetBestPeer ( ) : string
리턴 string

PeerQueue() 공개 메소드

Default constructor of the class.
public PeerQueue ( ) : System
리턴 System

PeerQueue() 공개 메소드

Constructor of the class used to actively insert a certain number of peer inside the queue.
public PeerQueue ( float>.Dictionary peerQueue ) : System
peerQueue float>.Dictionary /// A dictionay representing a bunch of peer each associated with a score of the peer. The less is /// the score, the better is the peer. ///
리턴 System

ResetPeer() 공개 메소드

Method used to reset the state of a single peer into the queue. It sets the new score (as passed) of the peer indicated.
public ResetPeer ( string key, int newScore ) : void
key string The URI representing the peer.
newScore int The new score of the peer.
리턴 void

this() 공개 메소드

Operator overload of the operator square brackets. It directly refers to the inner dictionary.
public this ( string key ) : PeerQueueElement
key string The URI of the peer to select
리턴 PeerQueueElement