websockets-rs / rust-websocket

A WebSocket (RFC6455) library written in Rust

Home Page:http://websockets-rs.github.io/rust-websocket/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Timeout on waiting for incoming WS connections

khionu opened this issue · comments

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.