Skip to content

Commit

Permalink
docs: discarded server TCP connection config (#1473)
Browse files Browse the repository at this point in the history
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 <luciofranco14@gmail.com>
  • Loading branch information
domodwyer and LucioFranco authored Aug 25, 2023
1 parent dc29c17 commit fa0ffbb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tonic/src/transport/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,10 @@ impl<L> Router<L> {
.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<I, IO, IE, ResBody>(
Expand Down Expand Up @@ -674,11 +676,13 @@ impl<L> Router<L> {
.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<I, IO, IE, F, ResBody>(
self,
Expand Down

0 comments on commit fa0ffbb

Please sign in to comment.