C# Class Brunet.Services.Dht.RpcDhtProxy

Provides RpcProxyHandler service, which reinserts dht entry before its ttl expires
Inheritance: IRpcHandler
Afficher le fichier Open project: pstjuste/brunet Class Usage Examples

Méthodes publiques

Свойство Type Description
RETRY_TIMEOUT int

Protected Properties

Свойство Type Description
_dht IDht
_entries Dictionary>
_rpc RpcManager
_sync object

Méthodes publiques

Méthode Description
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

Method Details

EntryCallback() public méthode

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
Résultat void

HandleRpc() public méthode

public HandleRpc ( ISender caller, string method, IList arguments, object request_state ) : void
caller ISender
method string
arguments IList
request_state object
Résultat void

ListEntries() public méthode

Returns all stored values in a list.
public ListEntries ( ) : object
Résultat object

Register() public méthode

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
Résultat bool

RpcDhtProxy() public méthode

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.
Résultat System

Unregister() public méthode

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
Résultat bool

Property Details

RETRY_TIMEOUT public_oe static_oe property

public static int RETRY_TIMEOUT
Résultat int

_dht protected_oe property

protected IDht _dht
Résultat IDht

_entries protected_oe property

protected Dictionary> _entries
Résultat Dictionary>

_rpc protected_oe property

protected RpcManager _rpc
Résultat RpcManager

_sync protected_oe property

protected object _sync
Résultat object