Skip to content

Commit ff0b124

Browse files
committed
Use TcpStream instead of hyper connect
1 parent 3542956 commit ff0b124

File tree

1 file changed

+3
-2
lines changed
  • tonic/src/transport/server

1 file changed

+3
-2
lines changed

tonic/src/transport/server/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use crate::body::BoxBody;
4343
use bytes::Bytes;
4444
use http::{Request, Response};
4545
use http_body::Body as _;
46-
use hyper::{server::accept, Body};
46+
use hyper::Body;
4747
use pin_project::pin_project;
4848
use std::{
4949
convert::Infallible,
@@ -57,6 +57,7 @@ use std::{
5757
time::Duration,
5858
};
5959
use tokio::io::{AsyncRead, AsyncWrite};
60+
use tokio::net::TcpStream;
6061
use tokio_stream::Stream;
6162
use tower::{
6263
layer::util::{Identity, Stack},
@@ -527,7 +528,7 @@ impl<L> Server<L> {
527528
let svc = self.service_builder.service(svc);
528529

529530
let tcp = incoming::tcp_incoming(incoming, self);
530-
let incoming = accept::from_stream::<_, _, crate::Error>(tcp);
531+
let incoming = TcpStream::accept::from_stream::<_, _, crate::Error>(tcp);
531532

532533
let svc = MakeSvc {
533534
inner: svc,

0 commit comments

Comments
 (0)