"error": "14 UNAVAILABLE: failed to connect to all addresses" c# .NET5.0 Newbie

2,673 views
Skip to first unread message

storm Dev

unread,
Sep 17, 2021, 2:48:39 PM9/17/21
to grpc.io
Hi,
I'm very newbie in gRPC and i had implemented a server client structure wich work perfecty on the same machine but return the error in object when i try to move client service on another machine.

My service is a consolle application write in c# .net5.0 with nuget pack of my proto project if i try to call my server with BloomRPC in the same machine i get the response but if i try by another pc with BloomRPC don't work.

this is the istance of server:

//Code

    const int Port = 30051;
      Server server = new Server
      {
        Services = { v0449gRpcSvc.BindService(new v0449gRpcSvcImpl()) },
        Ports = { new ServerPort("localhost", Port, ServerCredentials.Insecure) }
      };
      server.Start();

//EndCode

thanks for reply!!!

Yuri Golobokov

unread,
Sep 17, 2021, 4:59:43 PM9/17/21
to grpc.io
Hi!
Try to use "0.0.0.0" instead of localhost when creating ServerPort.
Listening on a localhost allows connection only from within the same machine.
Note that listening on "0.0.0.0" allows connections using any IP addresses the machine has.
On the client side please use the correct IP address of the machine to connect and not the "0.0.0.0"

storm Dev

unread,
Sep 18, 2021, 3:42:38 AM9/18/21
to Yuri Golobokov, grpc.io
I Love You!!! 

--
You received this message because you are subscribed to a topic in the Google Groups "grpc.io" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grpc-io/TqEjPkIIUs4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/be6feac1-79f6-48d0-b5a1-038dfcbcfd01n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages