Crates.io | goxoy_litep2p |
lib.rs | goxoy_litep2p |
version | |
source | src |
created_at | 2024-09-21 19:02:26.494709 |
updated_at | 2025-02-02 21:04:37.583342 |
description | Goxoy Lite P2P Library |
homepage | |
repository | https://github.com/Goxoy/goxoy_litep2p/ |
max_upload_size | |
id | 1382422 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Node'ların bağlantı ve mesaj iletim sürecinin yöneten kitaplık. Not :
{
"debug": false,
"store_node_list": true,
"addr": "127.0.0.1:1111",
"bootstrap": [
"127.0.0.1:1111"
]
}
// önce nesneyi oluşturup, sonrasında ayarları tanımlayabilirsiniz.
let mut msg_pool = MessagePool::new();
// config dosyasının adını parametre olarak verin
msg_pool.start(config_file_name);
// gerçekleşen Event için geri bir işlem dönecek
loop{
match msg_pool.on_event() {
EventType::OnMessage(_income_msg) => {
// diğer node veya node'lardan mesaj gönderildiğinde
// bu bölüm devreye giriyor
}
EventType::OnWait() => {
// eğer hiç bir işlem yok ise
// bu bölüm devreye giriyor
}
EventType::OnNodesSynced(_node_list_hash) => {
// bağlanan node'lar sayı ve durum açısından senkron olduğunda
// bu bölüm devreye giriyor
}
EventType::OnNodeStatusChanged(node_addr, node_status) => {
// eğer bir node Online veya Offline durumuna geçerse
// bu bölüm devreye giriyor
},
}
}