如何在Python和CPP中运行GRPC客户端?

发布于 2025-02-11 22:50:07 字数 109 浏览 1 评论 0原文

我正在尝试与client.py,server.cpp和一个make文件一起工作。我不了解如何运行文件并使用这些文件在GRPC上工作。任何人都可以帮助我理解这一概念并与客户,服务器和Protobuf合作吗?

I am trying to work with client.py , server.cpp and a make file. I am not understanding how to run the files and work on grpc with these files. Is it possible for anyone to help me understand this concept and work with the client, server and protobuf?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

星星的軌跡 2025-02-18 22:50:07

GRPC的整个想法是在跨平台服务之间启用基于协议的通信。表示您的CPP服务器可以与Python客户端通信。参考:官方grpc文档

  1. 第一步是<.proto file 这是服务器和客户端之间的协议关于特定RPC方法的请求 /响应应包含在什么属性上。
  2. 现在,可以用他们选择的任何语言来实现服务器,客户端。 只要服务器&amp;客户在单个原始文件上达成协议,基础过程由GRPC框架抽象,它只是有效的!!!

有关最快的动手,请参阅GRPC的快速启动指南, c ++ python 实现交叉平台服务器,客户端。

The whole idea of gRPC is to enable protocol based communication between cross platform services. Means your CPP server can communicate with python client. Ref: Official gRPC Documentation

  1. First step is to write a .proto file which is an agreement between server and client on what attributes should a request / response for a particular RPC method should contain.
  2. Now one can implement server, client in any language of their choice. As long as server & client agree on single proto file, underlying process is abstracted by gRPC framework and it just works!!!

For fastest hands-on, Refer to quick start guides of gRPC for c++, python to implement cross platform server, client.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文