tonic: set a conn timeout for balanced connections (#1215)

The `endpoint` supplied has a connection_timeout parameter which was
being ignored in this case.
This commit is contained in:
Thom Wright
2023-01-06 15:39:18 -05:00
committed by GitHub
parent 2ec0f87767
commit 0ca0630993
+1
View File
@@ -36,6 +36,7 @@ impl<K: Hash + Eq + Clone> Stream for DynamicServiceStream<K> {
let mut http = hyper::client::connect::HttpConnector::new();
http.set_nodelay(endpoint.tcp_nodelay);
http.set_keepalive(endpoint.tcp_keepalive);
http.set_connect_timeout(endpoint.connect_timeout);
http.enforce_http(false);
#[cfg(feature = "tls")]
let connector = service::connector(http, endpoint.tls.clone());