You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to build a uds channel without use try_from? Is there a way we can directly connect to the socket file? Will Endpoint::try_from panic when the socket address has already been using?
#[cfg(unix)]#[tokio::main]asyncfnmain() -> Result<(),Box<dyn std::error::Error>>{// We will ignore this uri because uds do not use it// if your connector does use the uri it will be provided// as the request to the `MakeConnection`.let channel = Endpoint::try_from("http://[::]:50051")?
.connect_with_connector(service_fn(|_:Uri| {let path = "/tmp/tonic/helloworld";// Connect to a Uds socketUnixStream::connect(path)})).await?;letmut client = GreeterClient::new(channel);let request = tonic::Request::new(HelloRequest{name:"Tonic".into(),});let response = client.say_hello(request).await?;println!("RESPONSE={:?}", response);Ok(())}
The text was updated successfully, but these errors were encountered:
Is there a string that can be provided to Endpoint::try_from() that will be guaranteed to fail such that we can be sure that the UDS file is used? Perahaps "" or "/dev/null". In the GEOPM use case, connecting to another endpoint would be a security concern:
Is there a way to build a uds channel without use try_from? Is there a way we can directly connect to the socket file? Will Endpoint::try_from panic when the socket address has already been using?
The text was updated successfully, but these errors were encountered: