Skip to content

Commit

Permalink
Use TcpStream instead of hyper connect
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludea committed Dec 19, 2023
1 parent 3542956 commit ff0b124
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tonic/src/transport/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use crate::body::BoxBody;
use bytes::Bytes;
use http::{Request, Response};
use http_body::Body as _;
use hyper::{server::accept, Body};
use hyper::Body;
use pin_project::pin_project;
use std::{
convert::Infallible,
Expand All @@ -57,6 +57,7 @@ use std::{
time::Duration,
};
use tokio::io::{AsyncRead, AsyncWrite};
use tokio::net::TcpStream;
use tokio_stream::Stream;
use tower::{
layer::util::{Identity, Stack},
Expand Down Expand Up @@ -527,7 +528,7 @@ impl<L> Server<L> {
let svc = self.service_builder.service(svc);

let tcp = incoming::tcp_incoming(incoming, self);
let incoming = accept::from_stream::<_, _, crate::Error>(tcp);
let incoming = TcpStream::accept::from_stream::<_, _, crate::Error>(tcp);

let svc = MakeSvc {
inner: svc,
Expand Down

0 comments on commit ff0b124

Please sign in to comment.