use std::sync::atomic::AtomicBool;
use std::time::Duration;
#[derive(Default)]
pub struct SocketReConn {
pub enable: AtomicBool,
pub time: Duration,
}
impl SocketReConn {
pub fn new(enable: bool, time: Duration) -> Self {
Self { enable: AtomicBool::new(enable), time }
}
pub fn enable(time: Duration) -> Self {
Self::new(true, time)
}
}