C# 클래스 Kademlia.Dht

This is the class you use to use the library. You can put and get values. It is responsible for bootstraping the local node and connecting to the appropriate overlay. It also registers us with the overlay.
파일 보기 프로젝트 열기: zencoders/sambatyon 1 사용 예제들

공개 메소드들

메소드 설명
Dht ( KademliaNode dhtNode = null, bool alreadyBootstrapped = false, string btpNode = "" ) : System

Create a DHT using the given master server, and specify whether to publish our IP. PRECONDITION: Create one per app or you will have a node ID collision.

Get ( string key ) : KademliaResource

Retrieve a value from the DHT.

GetAll ( string key ) : IList

Retrieve all applicable values from the DHT.

MaxSize ( ) : int

Returns the maximum size of individual puts.

Put ( string filename ) : void

Puts a value in the DHT under a key.

메소드 상세

Dht() 공개 메소드

Create a DHT using the given master server, and specify whether to publish our IP. PRECONDITION: Create one per app or you will have a node ID collision.
public Dht ( KademliaNode dhtNode = null, bool alreadyBootstrapped = false, string btpNode = "" ) : System
dhtNode KademliaNode The KademliaNode that is used to communicate using the protocol
alreadyBootstrapped bool Checks if the node have or not to bootstrap
btpNode string The node to bootstrap with (can be leaved null)
리턴 System

Get() 공개 메소드

Retrieve a value from the DHT.
public Get ( string key ) : KademliaResource
key string The key of the value to retrieve.
리턴 Persistence.KademliaResource

GetAll() 공개 메소드

Retrieve all applicable values from the DHT.
public GetAll ( string key ) : IList
key string The key of the value to retrieve.
리턴 IList

MaxSize() 공개 메소드

Returns the maximum size of individual puts.
public MaxSize ( ) : int
리턴 int

Put() 공개 메소드

Puts a value in the DHT under a key.
public Put ( string filename ) : void
filename string The filename of resource to store into the network
리턴 void