Function ping

Source
pub async fn ping(conn: &Connection) -> Result<()>
Expand description

Sends a ping message to test connectivity with a peer.

Opens a bidirectional stream, sends a Protocol::Ping message, and waits for a PONG response. Used for connection health checks.

ยงErrors

Returns an error if:

  • Failed to open bidirectional stream
  • Failed to send ping message
  • Failed to receive or incorrect pong response