swarm/src/behaviour: Add KeepAlive Behaviour #2778
Labels
difficulty:easy
getting-started
Issues that can be tackled if you don't know the internals of libp2p very well
help wanted
Description
When getting started with rust-libp2p, it is confusing that connections over time through the
KeepAlive
mechanism.See e.g. #2768 #2679
Today, users can import the
Ping
NetworkBehaviour
and setwith_keep_alive
.rust-libp2p/protocols/ping/src/handler.rs
Lines 103 to 116 in ce963df
I think there is value in a simple
KeepAlive
NetworkBehaviour
implementation, keeping the connection alive, without the need to importPing
. TheConnectionHandler
of theKeepAlive
NetworkBehaviour
could be exposed as well, thus allowing it to be used without its parentNetworkBehaviour
.Are you planning to do it yourself in a pull request?
No
The text was updated successfully, but these errors were encountered: