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 authored and ikrivosheev committed Jan 10, 2024
1 parent 5e32e00 commit cd05673
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 @@ -41,7 +41,7 @@ use crate::server::NamedService;
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 @@ -55,6 +55,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 @@ -525,7 +526,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 cd05673

Please sign in to comment.