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

Method on_open

Ch04/websocket/examples/unresponsive_timer.rs:19–23  ·  view source on GitHub ↗
(&mut self, _: Handshake)

Source from the content-addressed store, hash-verified

17}
18impl Handler for Server {
19 fn on_open(&mut self, _: Handshake) -> Result<()> {
20 println!("Opened a connetion");
21 self.out.timeout(15_000, CLIENT_UNRESPONSIVE)?;
22 self.out.timeout(5_000, PING)
23 }
24
25 fn on_timeout(&mut self, event: Token) -> Result<()> {
26 println!("event: {:?}", event);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected