This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lazy_static! { | |
static ref USMAP: Arc<Mutex<HashMap<String, UpdateServer>>> = Arc::new(Mutex::new(HashMap::new())); | |
} | |
#[derive(Debug)] | |
pub struct UpdateServer { | |
subdomain: String, | |
sa: SocketAddr, | |
sink: SplitSink<UdpFramed<BytesCodec>>, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::time::Duration; | |
use mio::{Events, Ready, Poll, PollOpt, Token}; | |
use mio_extras::channel; | |
use mio_extras::timer::Timer; | |
fn main() { | |
const CHANNEL: Token = Token(0); | |
let poll = Poll::new().unwrap(); | |
let (tx, rx) = channel::channel::<u32>(); | |
let mut events = Events::with_capacity(1024); |
OlderNewer