sách gpt4 ai đã đi

Triển khai DHT bằng C++

In lại 作者:塔克拉玛干 更新时间:2023-11-03 01:25:17 33 4
mua khóa gpt4 Nike

我正在寻找 Kademlia 的开源实现C/C++ 中的分布式哈希表。它必须是轻量级和跨平台的(win/linux/mac)。

它必须能够将信息发布到 DHT 并检索它。

1 Câu trả lời

OpenDHT是 C++11 中的轻量级 Kademlia DHT。 API 非常简单:

dht::DhtRunner node;

// Launch a dht node on a new thread, using a
// generated RSA key pair, and listen on port 4222.
node.run(4222, dht::crypto::generateIdentity(), true);

// Join the network through any running node,
// here using a known bootstrap node.
node.bootstrap("bootstrap.jami.net", "4222");

// put some data on the dht
std::vector some_data(5, 10);
node.put("unique_key", some_data);

它支持在 OS X、Linux 和 Windows 上使用 LLVM 或 GCC 进行编译。

关于DHT的C++实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6281543/

33 4 0
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com