Add option to disable DHT
This commit is contained in:
parent
1cd6caee76
commit
d121efd4f4
2 changed files with 37 additions and 14 deletions
|
|
@ -527,6 +527,13 @@ impl Dht {
|
|||
}
|
||||
pub async fn get_peers(&self, info_hash: Id20) -> impl StreamExt<Item = SocketAddr> {
|
||||
let (tx, rx) = unbounded_channel::<Response>();
|
||||
|
||||
// This is a hack to test localhost speeds, uncomment to test that quickly.
|
||||
//
|
||||
// tx.send(Response::Peer("127.0.0.1:27311".parse().unwrap()))
|
||||
// .unwrap();
|
||||
// std::mem::forget(tx);
|
||||
|
||||
self.request_tx
|
||||
.send((Request::GetPeers(info_hash), tx))
|
||||
.await
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue