c++ - 在 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 - 矩阵加法(从字符串中获取矩阵名称)
- sapui5 - 如何将组合框的输入设置为只读
- javascript - 为什么 classList.add 不适用于 html onClick
- c# - 导航栏中的 Umbraco 活动项目不起作用
- fortran - 异步 MPI
- javascript - 如果 AJAX 错误,如何停止 jquery 自动完成微调器
- guice - RestEasy ExceptionMapper 无法映射在过滤器级别引发的异常
- c++ - 如何从单个链表头文件在 main 中创建对象
- android-camera2 - android camera 2 API,LENS_FOCUS_DISTANCE 总是显示空
- android - 无法检查确切的文本大小