TLV(type-length-value) encode application layer package. 使用TLV(类型-长度-值)编码网络程序发送的应用层信息。

For new comer of network programming, there is a big obfuscation, "how to make my own protocol to encode package sends to peer network application?". Fortunately, pioneers of network programming leaves us a classical pattern, TLV(Type-Length-Value). Type and Length is fix size array, for instance, Type is 2 bytes, Length is 2 or 4 bytes. Length is the length of following value.
对于很多网络编程的新手来说,如何设计自己的通信协议是一个比较迷惑的问题。但是,前人给我们遗留下来了一个好的模式,(类型-长度-值)模式。类型和长度都是固定长度的字段,比如,类型一般是2个字节,长度一般是2个或者4个字节。长度指明了接下来包里面的值的长度。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值