Closed MaxKingPor closed 2 years ago
You should use server_with_incoming
instead of server_with_listener
.
Here is an example:
let listener = TcpListener::bind(addr).await?;
let incoming = TcpIncoming::from_listener(listener, true);
let server = Server::builder()
.accept_http1(true) // Support http1 for admin service.
.add_service(NodeServer::new(server.clone()))
.add_service(RaftServer::new(server.clone()))
.add_service(RootServer::new(server.clone()))
.add_service(make_admin_service(server.clone()))
.add_optional_service(proxy_server.map(EngulaServer::new))
.serve_with_incoming(incoming);
You should use
server_with_incoming
instead ofserver_with_listener
.Here is an example:
let listener = TcpListener::bind(addr).await?; let incoming = TcpIncoming::from_listener(listener, true); let server = Server::builder() .accept_http1(true) // Support http1 for admin service. .add_service(NodeServer::new(server.clone())) .add_service(RaftServer::new(server.clone())) .add_service(RootServer::new(server.clone())) .add_service(make_admin_service(server.clone())) .add_optional_service(proxy_server.map(EngulaServer::new)) .serve_with_incoming(incoming);
I created a PR , I hope it will be adopted
@MaxKingPor Hi, here already exists a PR: https://github.com/hyperium/tonic/pull/1093.
I'm sorry. I didn't see it. It's been closed.
Feature Request
Crates
Motivation
Proposal
Alternatives