websockets-rs / rust-websocket

A WebSocket (RFC6455) library written in Rust
http://websockets-rs.github.io/rust-websocket/
MIT License
1.55k stars 223 forks source link

Timeout on waiting for incoming WS connections #243

Open khionu opened 5 years ago

khionu commented 5 years ago

I would like to be able to run server.accept() and have it block for a Duration, after which I have an opportunity to perform other logic before continuing my loop.

My purpose is so I can implement a kill switch (an Arc<AtomicBool>, updated elsewhere) and end my thread if it's flipped.