zoukankan      html  css  js  c++  java
  • grpc(and socket?)

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

    和socket相比:

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

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

  • 相关阅读:
    建造者模式的使用场景
    由于losf引起的pxc启动报错处理
    mysql5.6源码自动安装脚本
    mysql5.7.16二进制安装
    Maven入门
    数据链路层
    图-拓扑排序
    线性表-队列
    线性表-链表
    Java基本概念(未完)
  • 原文地址:https://www.cnblogs.com/dongzhiquan/p/15665698.html
Copyright © 2011-2022 走看看