In gRPC, a client application can directly call a method on a server application on a different machine as if it were a local object, making it easier for you to create distributed applications and services. As in many RPC systems, gRPC is based around the idea of defining a service, specifying the methods that can be called remotely with their parameters and return types. On the server side, the server implements this interface and runs a gRPC server to handle client calls. On the client side, the client has a stub (referred to as just a client in some languages) that provides the same methods as the server.

 grpc(and socket?)

 

 

gRPC 是基于 HTTP/2 协议的,所以即使他能做到双向通信也会是类似websocket通信。而且grpc本身就是强区分客户端服务端,不为双向通信设计。

和socket相比:

gRPC 最大优势是编码使用protobuf,具备语言兼容性。使用 protocol buffers 的好处,包括高效的序列号,简单的 IDL 以及容易进行接口更新。 --不过反过来讲实际只使用protorbuf编码或者json编码同样可具备语言兼容性。

但是它和socket通信本身就是不同的东西,要解决的问题完全就是不同的。

相关文章:

  • 2022-02-23
  • 2022-12-23
  • 2021-06-22
  • 2021-11-08
  • 2021-09-01
  • 2021-08-16
  • 2022-01-25
  • 2022-12-23
猜你喜欢
  • 2022-01-04
  • 2022-12-23
  • 2021-11-23
  • 2021-10-06
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
相关资源
相似解决方案