#How to use polling with a socket and stdin
6 messages · Page 1 of 1 (latest)
i tried this:
let poller = Poller::new()?;
poller.add(&std::io::stdin(), Event::readable(0))?;
but i get this error
16 | poller.add(std::io::stdin(), Event::readable(0))?;
| ^^^ the trait `Source` is not implemented for `Stdin`
I haven't heard of polling before but I would suggest using https://docs.rs/tokio/
A runtime for writing reliable network applications without compromising speed.
async and Tokio is a very flexible way to write programs that need to respond to events from many sources