/// <summary> /// 构造一定长度的Message对象 /// </summary> /// <param name="BodySize"></param> public CMessage(int BodySize) { m_Body = new CByteBuffer(BodySize); }
/// <summary> /// 构造函数 /// </summary> /// <param name="OpCode"></param> /// <param name="data"></param> /// <param name="BodyLength"></param> public CMessage(int OpCode, byte[] data, int BodyLength = -1) { m_OpCode = ( ushort )OpCode; m_BodyLength = ( ushort )(BodyLength == -1 ? data.Length : BodyLength); m_Body = new CByteBuffer(data); }
/// <summary> /// 构造默认长度的message对象 /// </summary> public CMessage() { m_Body = new CByteBuffer(MAX_MESSAGE_BODY_SIZE); }