The Heartbeat PDU is sent by the server to the client and allows the client to monitor the state of the connection to the server in real time.
Inheritance: RdpbcgrServerPdu
        /// <summary>
        /// Decode Server Heartbeat PDU
        /// </summary>
        /// <param name="data"></param>
        /// <param name="decryptedUserData"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public StackPacket DecodeServerHeartbeatPDU(
            byte[] data,
            byte[] decryptedUserData,
            SecurityHeaderType type)
        {
            Server_Heartbeat_PDU pdu = new Server_Heartbeat_PDU();

            // data index
            int dataIndex = 0;

            // Server_Heartbeat_PDU: commonHeader
            pdu.commonHeader = ParseMcsCommonHeader(data, ref dataIndex, type);

            // user data index
            int userDataIndex = 0;

            if (type == SecurityHeaderType.None)
            {
                pdu.commonHeader.securityHeader = ParseTsSecurityHeaderBasic(decryptedUserData, ref userDataIndex);
            }

            // reserved
            pdu.reserved = ParseByte(decryptedUserData, ref userDataIndex);

            // reserved
            pdu.period = ParseByte(decryptedUserData, ref userDataIndex);

            // reserved
            pdu.count1 = ParseByte(decryptedUserData, ref userDataIndex);

            // reserved
            pdu.count2 = ParseByte(decryptedUserData, ref userDataIndex);

            // Check if data length exceeded expectation
            VerifyDataLength(decryptedUserData.Length, userDataIndex, ConstValue.ERROR_MESSAGE_DATA_LENGTH_EXCEEDED);
            return pdu;
        }
        public override StackPacket Clone()
        {
            Server_Heartbeat_PDU heartbeatPDU = new Server_Heartbeat_PDU();
            heartbeatPDU.commonHeader = this.commonHeader.Clone();
            heartbeatPDU.reserved = this.reserved;
            heartbeatPDU.period = this.period;
            heartbeatPDU.count1 = this.count1;
            heartbeatPDU.count2 = this.count2;

            return heartbeatPDU;
        }