C# Класс Brunet.Services.Dht.RpcDhtProxy

Provides RpcProxyHandler service, which reinserts dht entry before its ttl expires
Наследование: IRpcHandler
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
RETRY_TIMEOUT int

Защищенные свойства (Protected)

Свойство Тип Описание
_dht IDht
_entries Dictionary>
_rpc RpcManager
_sync object

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

Метод Описание
EntryCallback ( object o ) : void

If half of ttl time passed, this event handler is called. AlarmEventHandler calls "DhtClient.Put" command to insert the entry to other nodes. It restarts the timer. If error occurs during ASyncPut, it retries after 30 seconds

HandleRpc ( ISender caller, string method, IList arguments, object request_state ) : void
ListEntries ( ) : object

Returns all stored values in a list.

Register ( MemBlock key, MemBlock value, int ttl ) : bool

This is a RpcDhtProxy rpc call entry, which can be called using "RpcDhtProxy.Register" Register the entry to Entry. If the key,value pair does not exist in _entries, it creates the pair in the list. Otherwise, it updates the ttl. After inserting the entry, this module try to register the key, value pair to neighbor node.

RpcDhtProxy ( IDht dht, Node node ) : System

Initiates a RpcProxyHandler instance. It uses reflection for rpc call. Thus, it does not have to inherit IRpcHanler.This instance keeps Entry to keep track of key, value, and ttl

Unregister ( MemBlock key, MemBlock value ) : bool

Unregister the proxy entry. Removes the entry from Dictionary and set the stop the timer to disable future reference

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

EntryCallback() публичный Метод

If half of ttl time passed, this event handler is called. AlarmEventHandler calls "DhtClient.Put" command to insert the entry to other nodes. It restarts the timer. If error occurs during ASyncPut, it retries after 30 seconds
public EntryCallback ( object o ) : void
o object Entry which initiates ttl time expire event
Результат void

HandleRpc() публичный Метод

public HandleRpc ( ISender caller, string method, IList arguments, object request_state ) : void
caller ISender
method string
arguments IList
request_state object
Результат void

ListEntries() публичный Метод

Returns all stored values in a list.
public ListEntries ( ) : object
Результат object

Register() публичный Метод

This is a RpcDhtProxy rpc call entry, which can be called using "RpcDhtProxy.Register" Register the entry to Entry. If the key,value pair does not exist in _entries, it creates the pair in the list. Otherwise, it updates the ttl. After inserting the entry, this module try to register the key, value pair to neighbor node.
public Register ( MemBlock key, MemBlock value, int ttl ) : bool
key MemBlock dht entry key to insert
value MemBlock dht entry value to insert
ttl int dht entry ttl to insert
Результат bool

RpcDhtProxy() публичный Метод

Initiates a RpcProxyHandler instance. It uses reflection for rpc call. Thus, it does not have to inherit IRpcHanler.This instance keeps Entry to keep track of key, value, and ttl
public RpcDhtProxy ( IDht dht, Node node ) : System
dht IDht IDht instance
node Brunet.Node node which is currently connected.
Результат System

Unregister() публичный Метод

Unregister the proxy entry. Removes the entry from Dictionary and set the stop the timer to disable future reference
public Unregister ( MemBlock key, MemBlock value ) : bool
key MemBlock
value MemBlock
Результат bool

Описание свойств

RETRY_TIMEOUT публичное статическое свойство

public static int RETRY_TIMEOUT
Результат int

_dht защищенное свойство

protected IDht _dht
Результат IDht

_entries защищенное свойство

protected Dictionary> _entries
Результат Dictionary>

_rpc защищенное свойство

protected RpcManager _rpc
Результат RpcManager

_sync защищенное свойство

protected object _sync
Результат object