Send a ping and await the pong.
(&mut self)
| 213 | |
| 214 | /// Send a ping and await the pong. |
| 215 | pub async fn ping(&mut self) -> NodeDbResult<()> { |
| 216 | let resp = self.send(OpCode::Ping, TextFields::default()).await?; |
| 217 | if resp.status == ResponseStatus::Error { |
| 218 | return Err(NodeDbError::internal("ping failed")); |
| 219 | } |
| 220 | Ok(()) |
| 221 | } |
| 222 | |
| 223 | /// Whether this connection has been authenticated. |
| 224 | pub fn is_authenticated(&self) -> bool { |