From 8563770ec15209d80d35aa06420a57f44fd5541d Mon Sep 17 00:00:00 2001 From: sorz Date: Sat, 16 Dec 2017 02:51:37 +0800 Subject: [PATCH] Fix connect in parallel --- src/client/connect.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/connect.rs b/src/client/connect.rs index 00935bb..772449b 100644 --- a/src/client/connect.rs +++ b/src/client/connect.rs @@ -105,7 +105,7 @@ pub fn try_connect_all(dest: Destination, servers: Vec>, parallel_n: usize, wait_response: bool, pending_data: Option>, handle: Handle) -> TryConnectAll { - let parallel_n = cmp::min(1, parallel_n); + let parallel_n = cmp::max(1, parallel_n); let servers = VecDeque::from_iter(servers.into_iter()); TryConnectAll { dest, parallel_n, pending_data, wait_response, handle,