Skip to content

Commit

Permalink
Merge pull request #2 from Ludea/tcpstream
Browse files Browse the repository at this point in the history
Use TcpStream instead of hyper connect
  • Loading branch information
allan2 authored Jan 10, 2024
2 parents 3542956 + ff0b124 commit 52d6bc5
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 52d6bc5

Please sign in to comment.