As a pre-factor to #256, we clean up our connection handling. Namely, we move it to a new connection.rs file and clean up the logic a bit, allowing us to drop the dependency on the futures crate.
Then, we introduce a ConnectionManager that handles pending connection attempts. Previously, concurrent calls to
do_connect_peer/connect_peer_if_necessary could result in multiple connections being opened, just to be closed as redundant shortly after. Here, we fix this behavior by ensuring only one connection attempt is inflight at any given point in time.
Based on #243. Based on #244.
As a pre-factor to #256, we clean up our connection handling. Namely, we move it to a new
connection.rs
file and clean up the logic a bit, allowing us to drop the dependency on thefutures
crate.Then, we introduce a
ConnectionManager
that handles pending connection attempts. Previously, concurrent calls todo_connect_peer
/connect_peer_if_necessary
could result in multiple connections being opened, just to be closed as redundant shortly after. Here, we fix this behavior by ensuring only one connection attempt is inflight at any given point in time.