This commit is contained in:
Igor Katson 2023-11-28 09:23:05 +00:00
parent e012cd94a3
commit 0478577a72
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
3 changed files with 31 additions and 20 deletions

View file

@ -5,6 +5,7 @@ mod routing_table;
mod utils;
use std::sync::Arc;
use std::time::Duration;
pub use crate::dht::DhtStats;
pub use crate::dht::{DhtConfig, DhtState};
@ -13,6 +14,11 @@ pub use persistence::{PersistentDht, PersistentDhtConfig};
pub type Dht = Arc<DhtState>;
// How long do we wait for a response from a DHT node.
pub(crate) const RESPONSE_TIMEOUT: Duration = Duration::from_secs(60);
// After how long should we ping the node again.
pub(crate) const INACTIVITY_TIMEOUT: Duration = Duration::from_secs(15 * 60);
pub struct DhtBuilder {}
impl DhtBuilder {