thrift 基础知识点整理 server protocol transport

本文详细介绍了Thrift框架的三个核心组件:protocol、transport和server。protocol包括TBinaryProtocol、TCompactProtocol和TJSONProtocol等,分别对应二进制、压缩和JSON格式。transport部分涉及TSocket、TServerSocket、TBufferedTransport和TFramedTransport,它们在数据传输中的角色和特性。在server方面,对比了TSimpleServer、THsHaServer、TThreadedSelectorServer和TThreadPoolServer的异同,探讨了它们在处理并发连接和性能上的优缺点。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Thrift is a cross-language serialization/RPC framework with three major components, protocol, transport, and server. Protocol defines how messages are serialized. Transport defines how messages are communicated between client and server. Server receives serialized messages from the transport, deserializes them according to the protocol and invokes user-defined message handlers, and serializes the responses from the handlers and writes them back to the transport. The modular architecture of Thrift allows it to offer various choices of servers. Here are the list of server available for Java:

Thrift 是一个跨语言的序列化/RPC框架,它含有三个主要的组件:protocol,transport和server


1. protocol

  • TBinaryProtocol : 二进制格式.
  • TCompactProtocol : 压缩格式
  • TJSONProtocol : JSON格式
  • TSimpleJSONProtocol : 提供JSON只写协议, 生成的文件很容易通过脚本语言解析

2. transport

TSocket 阻塞型socket, 用于客户端

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值