For safety poller.add() requires:
The source must be delete()d from this Poller before it is dropped.
And the wait() example code has:
unsafe {
poller.add(&socket, Event::all(key))?;
}
let mut events = Events::new();
let n = poller.wait(&mut events, Some(Duration::from_secs(1)))?;
poller.delete(&socket)?;
The ? at the wait() call may cause an Error return without delete() being called.
Is this example safe?