mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 02:35:31 +00:00
udp: replace PanicSentinel with loop over JoinHandles
This commit is contained in:
parent
239266ddab
commit
8f838098aa
6 changed files with 97 additions and 58 deletions
|
|
@ -10,7 +10,7 @@ use crossbeam_channel::Receiver;
|
|||
use crossbeam_channel::Sender;
|
||||
use rand::{rngs::SmallRng, SeedableRng};
|
||||
|
||||
use aquatic_common::{CanonicalSocketAddr, PanicSentinel, ValidUntil};
|
||||
use aquatic_common::{CanonicalSocketAddr, ValidUntil};
|
||||
|
||||
use crate::common::*;
|
||||
use crate::config::Config;
|
||||
|
|
@ -18,7 +18,6 @@ use crate::config::Config;
|
|||
use storage::TorrentMaps;
|
||||
|
||||
pub struct SwarmWorker {
|
||||
pub _sentinel: PanicSentinel,
|
||||
pub config: Config,
|
||||
pub state: State,
|
||||
pub server_start_instant: ServerStartInstant,
|
||||
|
|
@ -29,7 +28,7 @@ pub struct SwarmWorker {
|
|||
}
|
||||
|
||||
impl SwarmWorker {
|
||||
pub fn run(&mut self) {
|
||||
pub fn run(&mut self) -> anyhow::Result<()> {
|
||||
let mut torrents = TorrentMaps::default();
|
||||
let mut rng = SmallRng::from_entropy();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue