C# 클래스 Brunet.Services.Dht.RpcDhtProxy

Provides RpcProxyHandler service, which reinserts dht entry before its ttl expires
상속: IRpcHandler
파일 보기 프로젝트 열기: pstjuste/brunet 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
RETRY_TIMEOUT int

보호된 프로퍼티들

프로퍼티 타입 설명
_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