Skip to content

Commit

Permalink
Fix uds example on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpdrsn committed May 17, 2021
1 parent 2318134 commit 85185ef
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions examples/src/uds/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ impl Greeter for MyGreeter {
&self,
request: Request<HelloRequest>,
) -> Result<Response<HelloReply>, Status> {
let conn_info = request.extensions().get::<unix::UdsConnectInfo>().unwrap();
println!("Got a request {:?} with info {:?}", request, conn_info);
#[cfg(unix)]
{
let conn_info = request.extensions().get::<unix::UdsConnectInfo>().unwrap();
println!("Got a request {:?} with info {:?}", request, conn_info);
}

let reply = hello_world::HelloReply {
message: format!("Hello {}!", request.into_inner().name),
Expand Down

0 comments on commit 85185ef

Please sign in to comment.