From fa0ffbbd3d34394941ec5a8c0a5eee5e296dd577 Mon Sep 17 00:00:00 2001 From: Dom Date: Fri, 25 Aug 2023 19:22:28 +0100 Subject: [PATCH] docs: discarded server TCP connection config (#1473) The Server type accepts TCP configuration parameters (keepalive & TCP_NODELAY) which are only respected when using serve() or serve_with_shutdown(). Serve methods that take a stream of AsyncRead + AsyncWrite are necessarily unaware of the underlying transport, and therefore silently discard any TCP specific configuration. Co-authored-by: Lucio Franco --- tonic/src/transport/server/mod.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tonic/src/transport/server/mod.rs b/tonic/src/transport/server/mod.rs index 2ac31f14c..5a9c1c85a 100644 --- a/tonic/src/transport/server/mod.rs +++ b/tonic/src/transport/server/mod.rs @@ -645,8 +645,10 @@ impl Router { .await } - /// Consume this [`Server`] creating a future that will execute the server on - /// the provided incoming stream of `AsyncRead + AsyncWrite`. + /// Consume this [`Server`] creating a future that will execute the server + /// on the provided incoming stream of `AsyncRead + AsyncWrite`. + /// + /// This method discards any provided [`Server`] TCP configuration. /// /// [`Server`]: struct.Server.html pub async fn serve_with_incoming( @@ -674,11 +676,13 @@ impl Router { .await } - /// Consume this [`Server`] creating a future that will execute the server on - /// the provided incoming stream of `AsyncRead + AsyncWrite`. Similar to + /// Consume this [`Server`] creating a future that will execute the server + /// on the provided incoming stream of `AsyncRead + AsyncWrite`. Similar to /// `serve_with_shutdown` this method will also take a signal future to /// gracefully shutdown the server. /// + /// This method discards any provided [`Server`] TCP configuration. + /// /// [`Server`]: struct.Server.html pub async fn serve_with_incoming_shutdown( self,