首页 > 解决方案 > 在 Windows 代码中运行的 grpc 客户端 c++ 未连接到 grpc 服务器

问题描述

grpc 服务器和客户端是在 Visual Studio 2017 上构建的,没有任何错误。但是当我尝试将客户端应用程序与服务器连接时,它会给出错误消息

E0924 12:32:13.475000000  5800 resolver_registry.cc:80] don't know how to resolve 'localhost:50051' or 'dns:///localhost:50051'
E0924 12:32:13.497000000  5800 resolver_registry.cc:80] don't know how to resolve 'dns:///localhost:50051' or 'dns:///dns:///localhost:50051'
E0924 12:32:13.525000000  5800 channel.cc:99] channel stack builder failed: {"created":"@1569308533.525000000","description":"resolver creation failed","file":"E:\Grpctest\grpc\src\core\ext\filters\client_channel\resolving_lb_policy.cc","file_line":233}
 {
    std::string address("127.0.0.1:50051");
    MathTestClient client(
        grpc::CreateChannel(
            address,
            grpc::InsecureChannelCredentials()
        )
    );

标签: c++windows

解决方案


推荐阅读