Esempio n. 1
0
        public new static MSG_KEEPALIVE FromBitArray(ref BitArray bit_array, ref int cursor, int length)
        {
            if (cursor > length) return null;

            int field_len = 0;
            object obj_val;
            ArrayList param_list = new ArrayList();

            MSG_KEEPALIVE obj = new MSG_KEEPALIVE();

            int msg_type = 0;
            cursor += 6;
            msg_type = (int)(UInt64)Util.CalculateVal(ref bit_array, ref cursor, 10);

            if (msg_type != obj.msgType)
            {
                cursor -= 16;
                return null;
            }

            obj.msgLen = (UInt32)(UInt64)Util.CalculateVal(ref bit_array, ref cursor, 32);
            obj.msgID = (UInt32)(UInt64)Util.CalculateVal(ref bit_array, ref cursor, 32);


            return obj;
        }
Esempio n. 2
0
        public new static MSG_KEEPALIVE FromString(string str)
        {
            string val;

            XmlDocument xdoc = new XmlDocument();
            xdoc.LoadXml(str);
            XmlNode node = (XmlNode)xdoc.DocumentElement;

            MSG_KEEPALIVE msg = new MSG_KEEPALIVE();
            try { msg.MSG_ID = Convert.ToUInt32(XmlUtil.GetNodeAttrValue(node, "MessageID")); }
            catch { }


            return msg;
        }
Esempio n. 3
0
        protected void TriggerKeepAlive(MSG_KEEPALIVE msg)
        {
            try
            {
                if (OnKeepAlive != null) OnKeepAlive(msg);
                if (OnEncapedKeepAlive != null)
                {
                    ENCAPED_KEEP_ALIVE keepalive = new ENCAPED_KEEP_ALIVE();
                    keepalive.reader = reader_name;
                    keepalive.keep_alive = msg;

                    OnEncapedKeepAlive(keepalive);
                }
            }
            catch { }
        }