C# Class Brunet.Services.Dht.RpcDht

Provides a BrunetRpc wrapper around the Dht so that the local node can perform Dht operations.
This replaces the older DhtClient. The default behavior is to limit requests to the local node.
Inheritance: IRpcHandler
Show file Open project: pstjuste/brunet

Public Properties

Property Type Description
LocalUseOnly bool

Protected Properties

Property Type Description
_channels Brunet.Collections.Cache
_dht IDht
_node Brunet.Node

Public Methods

Method Description
BeginGet ( MemBlock key ) : byte[]

A slighlty more async version of Get

ContinueGet ( MemBlock token, object rs ) : void

Block until a value returns from the get or the get ends.

EndGet ( MemBlock token ) : void

Closes a BeginGet.

HandleRpc ( ISender caller, string method, IList args, object rs ) : void
RpcDht ( IDht dht, Node node ) : Brunet

Protected Methods

Method Description
GenToken ( MemBlock key ) : byte[]

Method Details

BeginGet() public method

A slighlty more async version of Get
public BeginGet ( MemBlock key ) : byte[]
key MemBlock Key to retrieve
return byte[]

ContinueGet() public method

Block until a value returns from the get or the get ends.
public ContinueGet ( MemBlock token, object rs ) : void
token MemBlock A token to specify which get to follow up.
rs object
return void

EndGet() public method

Closes a BeginGet.
public EndGet ( MemBlock token ) : void
token MemBlock A token to specify which get to close.
return void

GenToken() protected method

protected GenToken ( MemBlock key ) : byte[]
key MemBlock
return byte[]

HandleRpc() public method

public HandleRpc ( ISender caller, string method, IList args, object rs ) : void
caller ISender
method string
args IList
rs object
return void

RpcDht() public method

public RpcDht ( IDht dht, Node node ) : Brunet
dht IDht
node Brunet.Node
return Brunet

Property Details

LocalUseOnly public property

If true, only local node can perform ops. When false anyone can.
public bool LocalUseOnly
return bool

_channels protected property

protected Brunet.Collections.Cache _channels
return Brunet.Collections.Cache

_dht protected property

protected IDht _dht
return IDht

_node protected property

protected Node,Brunet _node
return Brunet.Node