(&mut self)
| 292 | } |
| 293 | |
| 294 | async fn send_ping(&mut self) -> bool { |
| 295 | match self.send(Message::Ping(vec![69])).await { |
| 296 | Ok(_) => true, |
| 297 | Err(reason) => { |
| 298 | self.close(reason).await; |
| 299 | false |
| 300 | } |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | async fn send(&mut self, msg: Message) -> WsResult { |
| 305 | if self.socket.send(msg).await.is_err() { |