Show the crate…

3 unstable releases

0.28.0 Mar 12, 2021
0.27.1 Apr 3, 2021
0.27.0 Apr 2, 2021
0.0.0 Mar 11, 2021

#8 in #tetsy-libp2p

Download history 45/week @ 2024-04-01 21/week @ 2024-04-08 24/week @ 2024-04-15 30/week @ 2024-04-22 22/week @ 2024-04-29 22/week @ 2024-05-06 31/week @ 2024-05-13 18/week @ 2024-05-20 31/week @ 2024-05-27 27/week @ 2024-06-03 22/week @ 2024-06-10 16/week @ 2024-06-17 31/week @ 2024-06-24 8/week @ 2024-07-08 32/week @ 2024-07-15

72 downloads per month
Used in 36 crates (via tetsy-libp2p)

MIT license

680KB
12K SLoC

tetsy-libp2p-ping

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 Ping struct implements the NetworkBehaviour trait. When used with a Swarm, it will respond to inbound ping requests and as necessary periodically send outbound ping requests on every established connection. If a configurable number of consecutive pings fail, the connection will be closed.

The Ping network behaviour produces PingEvents, which may be consumed from the Swarm by an application, e.g. to collect statistics.

Note: The ping protocol does not keep otherwise idle connections alive by default, see PingConfig::with_keep_alive for changing this behaviour.


lib.rs:

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 Ping struct implements the NetworkBehaviour trait. When used with a Swarm, it will respond to inbound ping requests and as necessary periodically send outbound ping requests on every established connection. If a configurable number of consecutive pings fail, the connection will be closed.

The Ping network behaviour produces PingEvents, which may be consumed from the Swarm by an application, e.g. to collect statistics.

Note: The ping protocol does not keep otherwise idle connections alive by default, see PingConfig::with_keep_alive for changing this behaviour.

Dependencies

~10–15MB
~306K SLoC