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.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
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