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.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
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