From f76b00ad63bc214866ef5916c44817ab738cbd10 Mon Sep 17 00:00:00 2001 From: Thomas Scholtes Date: Wed, 21 Apr 2021 15:11:11 +0200 Subject: [PATCH] Connect to discovered peers concurrently MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before, connecting to a discovered peer would block the connecting to the peer discovered next. This would cause particular problems when we tried to connect to a peer that isn’t reachable and the connection would result in a timeout. Signed-off-by: Thomas Scholtes --- librad/src/net/protocol/accept.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/librad/src/net/protocol/accept.rs b/librad/src/net/protocol/accept.rs index 701e28b15..d08b13509 100644 --- a/librad/src/net/protocol/accept.rs +++ b/librad/src/net/protocol/accept.rs @@ -28,7 +28,7 @@ where D: futures::Stream)>, { disco - .for_each(|(peer, addrs)| { + .for_each_concurrent(10, |(peer, addrs)| { let state = state.clone(); async move { io::discovered(state, peer, addrs).await } })