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
extern crate futures; | |
#[macro_use] | |
extern crate tokio_core; | |
use std::env; | |
use std::io::{Error, ErrorKind}; | |
use std::net::SocketAddr; | |
use futures::{Async, Future, Poll}; | |
use tokio_core::net::UdpSocket; |
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
extern crate rotor; | |
use std::io::{Write, stderr}; | |
use std::ops::DerefMut; | |
use rotor::{EventSet, PollOpt, Loop, Config, Void}; | |
use rotor::mio::udp::{UdpSocket}; | |
use rotor::{Machine, Response, EarlyScope, Scope}; | |
struct Context { | |
buf: [u8; 1024], |