mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
ws protocol: remove glob exports; adjust dependent crates
This commit is contained in:
parent
27ecccd984
commit
0dae7fd533
10 changed files with 46 additions and 17 deletions
|
|
@ -1,9 +1,8 @@
|
|||
use std::sync::{atomic::AtomicUsize, Arc};
|
||||
|
||||
use aquatic_ws_protocol::common::InfoHash;
|
||||
use rand_distr::Gamma;
|
||||
|
||||
pub use aquatic_ws_protocol::*;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Statistics {
|
||||
pub requests: AtomicUsize,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ use std::time::{Duration, Instant};
|
|||
|
||||
use aquatic_common::cpu_pinning::glommio::{get_worker_placement, set_affinity_for_util_worker};
|
||||
use aquatic_common::cpu_pinning::WorkerIndex;
|
||||
use aquatic_ws_protocol::common::InfoHash;
|
||||
use glommio::LocalExecutorBuilder;
|
||||
use rand::prelude::*;
|
||||
use rand_distr::Gamma;
|
||||
|
|
|
|||
|
|
@ -6,10 +6,16 @@ use std::{
|
|||
time::Duration,
|
||||
};
|
||||
|
||||
use aquatic_ws_protocol::incoming::{
|
||||
AnnounceEvent, AnnounceRequest, AnnounceRequestOffer, InMessage, ScrapeRequestInfoHashes,
|
||||
};
|
||||
use aquatic_ws_protocol::outgoing::OutMessage;
|
||||
use aquatic_ws_protocol::{
|
||||
AnnounceAction, AnnounceEvent, AnnounceRequest, AnnounceRequestOffer, InMessage, InfoHash,
|
||||
OfferId, OutMessage, PeerId, RtcAnswer, RtcAnswerType, RtcOffer, RtcOfferType, ScrapeAction,
|
||||
ScrapeRequest, ScrapeRequestInfoHashes,
|
||||
common::{
|
||||
AnnounceAction, InfoHash, OfferId, PeerId, RtcAnswer, RtcAnswerType, RtcOffer,
|
||||
RtcOfferType, ScrapeAction,
|
||||
},
|
||||
incoming::ScrapeRequest,
|
||||
};
|
||||
use async_tungstenite::{client_async, WebSocketStream};
|
||||
use futures::{SinkExt, StreamExt};
|
||||
|
|
@ -168,7 +174,7 @@ impl Connection {
|
|||
}),
|
||||
event: None,
|
||||
offers: None,
|
||||
action: aquatic_ws_protocol::AnnounceAction::Announce,
|
||||
action: AnnounceAction::Announce,
|
||||
peer_id: self.peer_id,
|
||||
bytes_left: Some(bytes_left),
|
||||
numwant: Some(0),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue