|*2*|*2*|**4**|***************n***********|
|dm|ProtocolFlags|Length|Data|
|head|ushort|int32|bytes|
public class DmtpMessage : DisposableObject,
IFixedHeaderByteBlockRequestInfo, IRequestInfo, IRequestInfoBuilder, IByteBlockBuilder
Public Class DmtpMessage
Inherits DisposableObject
Implements IFixedHeaderByteBlockRequestInfo, IRequestInfo, IRequestInfoBuilder, IByteBlockBuilder
type DmtpMessage =
class
inherit DisposableObject
interface IFixedHeaderByteBlockRequestInfo
interface IRequestInfo
interface IRequestInfoBuilder
interface IByteBlockBuilder
end
DmtpMessage |
Dmtp协议的消息。
|*2*|*2*|**4**|***************n***********| |Head|ProtocolFlags|Length|Data| |dm|ushort|int32|bytes| |
DmtpMessage(UInt16) |
Dmtp协议的消息。
|*2*|**4**|***************n***********| |ProtocolFlags|Length|Data| |ushort|int32|bytes| |
BodyByteBlock | 实际使用的Body数据。 |
DisposedValue |
标识该对象是否已被释放
(继承自 DisposableObject。) |
MaxLength |
构建数据时,指示内存池的申请长度。
建议:该值可以尽可能的设置大一些,这样可以避免内存池扩容。 |
ProtocolFlags | 协议标识 |
BuildTByteBlock | 构建数据到ByteBlock |
CreateFrom |
从当前内存中解析出一个DmtpMessage 注意:
|
Dispose |
释放资源。内部已经处理了SuppressFinalize(Object) (继承自 DisposableObject。) |
Dispose(Boolean) |
处置资源
(重写 DisposableObjectDispose(Boolean)) |
Equals | Determines whether the specified object is equal to the current object. (继承自 Object。) |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (继承自 Object。) |
GetBodyString | 将BodyByteBlock的有效数据转换为utf-8的字符串。 |
GetHashCode | Serves as the default hash function. (继承自 Object。) |
GetType | Gets the Type of the current instance. (继承自 Object。) |
MemberwiseClone | Creates a shallow copy of the current Object. (继承自 Object。) |
ThrowIfDisposed |
判断当前对象是否已经被释放。
如果已经被释放,则抛出ObjectDisposedException异常。
(继承自 DisposableObject。) |
ToString | Returns a string that represents the current object. (继承自 Object。) |
Head | Head |
Build |
扩展方法,用于构建给定的字节块。
该方法通过引用传递字节块,以利用ref参数提高性能,避免不必要的复制。
(由 ByteBlockBuilderExtension 定义。) |
BuildAsBytes |
将对象构建到字节数组
(由 DataHandlingAdapterExtension 定义。) |
Map | (由 Mapper 定义。) |
Map | (由 Mapper 定义。) |
MapTTarget | (由 Mapper 定义。) |
ToJsonString |
转换为Json
(由 SerializeConvert 定义。) |
IFixedHeaderByteBlockRequestInfoBodyLength | 数据体长度 |
IFixedHeaderByteBlockRequestInfoOnParsingBody |
当收到数据,由框架封送有效载荷数据。
如果返回false,意味着放弃本次解析的所有数据,包括已经解析完成的Header |
IFixedHeaderByteBlockRequestInfoOnParsingHeader |
当收到数据,由框架封送固定协议头。
您需要在此函数中,解析自己的固定包头,并且对BodyLength赋值后续数据的长度,然后返回True。 如果返回false,则意味着放弃本次解析 |