Skip to content

Commit

Permalink
serve multiple connections
Browse files Browse the repository at this point in the history
  • Loading branch information
howardjohn committed Feb 14, 2024
1 parent 22cb1c8 commit 6b80615
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/test_helpers/xds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,17 @@ impl AdsServer {
tokio::spawn(async move {
while let Some(socket) = tls_stream.next().await {
let srv = srv.clone();
if let Err(err) = http2::Builder::new(TokioExecutor)
.serve_connection(
TokioIo::new(socket),
tower_hyper_http_body_compat::TowerService03HttpServiceAsHyper1HttpService::new(srv)
)
.await
{
error!("Error serving connection: {:?}", err);
}
tokio::spawn(async move {
if let Err(err) = http2::Builder::new(TokioExecutor)
.serve_connection(
TokioIo::new(socket),
tower_hyper_http_body_compat::TowerService03HttpServiceAsHyper1HttpService::new(srv)
)
.await
{
error!("Error serving connection: {:?}", err);
}
});
}
});

Expand Down

0 comments on commit 6b80615

Please sign in to comment.