IdentifyType() public static method

Parse the MsgType from a FIX string
public static IdentifyType ( string msgstr ) : MsgType
msgstr string string of a FIX message
return QuickFix.Fields.MsgType
コード例 #1
0
        public void Next(string msgStr)
        {
            try
            {
                this.Log.OnIncoming(msgStr);

                MsgType msgType     = Message.IdentifyType(msgStr);
                string  beginString = Message.ExtractBeginString(msgStr);

                Message message = msgFactory_.Create(beginString, msgType.Obj);
                message.FromString(
                    msgStr,
                    this.ValidateLengthAndChecksum,
                    this.SessionDataDictionary,
                    this.ApplicationDataDictionary);

                Next(message);
            }
            catch (InvalidMessage e)
            {
                this.Log.OnEvent(e.Message);

                try
                {
                    if (MsgType.LOGON.Equals(Message.IdentifyType(msgStr)))
                    {
                        Disconnect("Logon message is not valid");
                    }
                }
                catch (MessageParseError)
                { }

                throw e;
            }
        }
コード例 #2
0
        internal MessageBuilder(
            string msgStr,
            bool validateLengthAndChecksum,
            DataDictionary.DataDictionary sessionDD,
            DataDictionary.DataDictionary appDD,
            IMessageFactory msgFactory)
        {
            _msgStr = msgStr;
            _validateLengthAndChecksum = validateLengthAndChecksum;
            _sessionDD  = sessionDD;
            _appDD      = appDD;
            _msgFactory = msgFactory;

            _msgType     = Message.IdentifyType(_msgStr);
            _beginString = Message.ExtractBeginString(_msgStr);
        }