BufferPacketParser 类
BufferPacketParser消息格式化器抽象类 这个不会用在TCP协议中、因此不用考虑分包和粘包的问题。 目前这个只会用在KCP协议中、因为KCP出来的就是一个完整的包、所以可以一次性全部解析出来。 如果是用在其他协议上可能会出现问题。
继承
BufferPacketParser
实现
继承成员
命名空间: Fantasy.PacketParser
程序集: Fantasy.Net.dll
语法
public abstract class BufferPacketParser : APacketParser, IDisposable
字段
| 编辑本文 查看源代码MessagePacketLength
声明
protected int MessagePacketLength
字段值
类型 | 描述 |
---|---|
int |
ProtocolCode
声明
protected uint ProtocolCode
字段值
类型 | 描述 |
---|---|
uint |
RouteId
声明
protected long RouteId
字段值
类型 | 描述 |
---|---|
long |
RpcId
声明
protected uint RpcId
字段值
类型 | 描述 |
---|---|
uint |
方法
| 编辑本文 查看源代码Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
声明
public override void Dispose()
重写
| 编辑本文 查看源代码UnPack(byte[], ref int, out APackInfo)
解包方法
声明
public abstract bool UnPack(byte[] buffer, ref int count, out APackInfo packInfo)
参数
类型 | 名称 | 描述 |
---|---|---|
byte[] | buffer | buffer |
int | count | count |
APackInfo | packInfo | packInfo |
返回
类型 | 描述 |
---|---|
bool |