MCPcopy Create free account
hub / github.com/Apress/practical-rust-web-projects / main

Function main

Ch04/websocket/examples/unresponsive_timer.rs:114–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112}
113
114fn main() {
115 let server = WebSocket::new(|out| Server {
116 out: out,
117 ping_timeout: None,
118 client_unresponsive_timeout: None,
119 })
120 .unwrap();
121 let broadcaster = server.broadcaster();
122
123 let periodic = thread::spawn(move || loop {
124 broadcaster.send("Meow").unwrap();
125 thread::sleep(time::Duration::from_secs(1));
126 });
127 server.listen("127.0.0.1:8080").unwrap();
128 periodic.join().unwrap();
129}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected