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

Method on_frame

Ch04/websocket/examples/unresponsive_timer.rs:89–100  ·  view source on GitHub ↗
(
        &mut self,
        frame: Frame,
    )

Source from the content-addressed store, hash-verified

87 }
88
89 fn on_frame(
90 &mut self,
91 frame: Frame,
92 ) -> Result<Option<Frame>> {
93 if frame.opcode() == OpCode::Pong {
94 println!("Received a pong");
95 // Reset the CLIENT_UNRESPONSIVE timeout
96 self.out.timeout(15_000, CLIENT_UNRESPONSIVE)?;
97 }
98
99 Ok(Some(frame))
100 }
101
102 fn on_close(&mut self, code: CloseCode, reason: &str) {
103 println!(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected