43 breaking releases

0.44.1 May 1, 2024
0.44.0 Nov 5, 2023
0.43.1 Sep 22, 2023
0.43.0 Jun 20, 2023
0.6.0 Mar 29, 2019

#1778 in Network programming

Download history 41105/week @ 2024-01-19 39827/week @ 2024-01-26 37822/week @ 2024-02-02 41036/week @ 2024-02-09 47849/week @ 2024-02-16 45272/week @ 2024-02-23 39380/week @ 2024-03-01 39412/week @ 2024-03-08 41082/week @ 2024-03-15 44704/week @ 2024-03-22 51232/week @ 2024-03-29 52618/week @ 2024-04-05 49946/week @ 2024-04-12 46332/week @ 2024-04-19 36601/week @ 2024-04-26 35107/week @ 2024-05-03

177,256 downloads per month
Used in 186 crates (8 directly)

MIT license

755KB
15K SLoC

This module implements the /ipfs/ping/1.0.0 protocol.

The ping protocol can be used as a simple application-layer health check for connections of any Transport as well as to measure and record round-trip times.

Usage

The Behaviour struct implements the NetworkBehaviour trait. It will respond to inbound ping requests and periodically send outbound ping requests on every established connection.

It is up to the user to implement a health-check / connection management policy based on the ping protocol.

For example:

  • Disconnect from peers with an RTT > 200ms
  • Disconnect from peers which don't support the ping protocol
  • Disconnect from peers upon the first ping failure

Users should inspect emitted Events and call APIs on Swarm:

Dependencies

~8–16MB
~220K SLoC