Example #1
0
        private void session_InboundSessionMsgEvent(object sender, InboundSessionMsgEventArgs args)
        {
            eventView.LogIncomingMessage(args.Msg);

            if (MsgType.Logon == args.Msg.Type)
            {
                string sectionName;
                if (sender == tradingSession)
                {
                    sectionName = "TradingSession";
                }
                else
                {
                    sectionName = "MarketDataSession";
                }
                SessionConfiguration settings = (SessionConfiguration)ConfigurationHelper.GetSection(sectionName);

                if (!string.IsNullOrEmpty(settings.RawData))
                {
                    if (settings.RawData != args.Msg[Tags.RawData])
                    {
                        throw new ApplicationException("Invalid RawData");
                    }
                }

                if (!string.IsNullOrEmpty(settings.Username))
                {
                    if (settings.Username != args.Msg[Tags.Username])
                    {
                        throw new ApplicationException("Invalid Username");
                    }
                }
                if (!string.IsNullOrEmpty(settings.Password))
                {
                    if (settings.Password != args.Msg[Tags.Password])
                    {
                        throw new ApplicationException("Invalid Password");
                    }
                }
            }
        }
Example #2
0
 void acceptor_InboundSessionMsgEvent(object sender, InboundSessionMsgEventArgs args)
 {
     Console.WriteLine("\nAcceptor received " + args.Msg.ToString(Message.StringFormat.TAG_NAME, '|'));
 }
Example #3
0
 void session_InboundSessionMsgEvent(object sender, InboundSessionMsgEventArgs args)
 {
     eventView.LogIncomingMessage(args.Msg);
 }