0

I am trying to connect my gRPC client which is written in C# to another gRPC server which is written in C++.
I have configured my gRPC client to use the gRPC server as the endpoint address.

public void ConfigureService(IServiceCollection services)
{
    string address = "http://localhost:65000"
    services.AddGrpcClient<GreeterService.GreeterServiceClient>(options =>
    {
        options.Address = new Uri(address);
    });
}

At the gRPC server side, it was configured as follows:

CGreeterServer::CGreeterServer()
{
    // Other codes in constructor
    grpc::ServerBuilder builder;
    builder.AddListeningPort("localhost:65000", grpc::InsecureServerCredentials());
    builder.RegisterService(m_pGreeterService);
    m_pServer = builder.BuildAndStart();
}

I am not sure what is happening but I keep getting error messages on the client side saying that the call has been cancelled or Call failed with gRPC error status. Status code: Internal, Message Error starting gRPC call: An error occurred while sending the request.

Any advice on this issue is greatly appreciated.

amsga
  • 98
  • 12
  • I'd recommend enabling extra logging on both the server and the client. For C++ server: https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md. For grpc-dotnet client, you can enable the logging like this: https://learn.microsoft.com/en-us/aspnet/core/grpc/diagnostics?view=aspnetcore-7.0 – Jan Tattermusch Jun 26 '23 at 10:05
  • Also, you can use wireshark to analyze the HTTP traffic on the wire (which could help determining what went wrong). – Jan Tattermusch Jun 26 '23 at 10:05

0 Answers0