Ejemplo n.º 1
0
        public void FromAdmin(QuickFix.Message msg, QuickFix.SessionID s)
        {
            string errormsg = "Error: ";

            try
            {
                string msgType = msg.Header.GetField(Tags.MsgType);
                if (msgType == MsgType.LOGON)
                {
                    QuickFix.FIX44.Logon logonMsg = msg as QuickFix.FIX44.Logon;
                    if (logonMsg != null)
                    {
                        // Validates sender & target compids
                        string sndCompID = s.SenderCompID;
                        string tgtCompID = s.TargetCompID;
                        string password  = logonMsg.IsSetField(96)? logonMsg.GetString(96): string.Empty;

                        logger.DebugFormat("snd[{0}] tgt[{1}] pwd[{2}]", sndCompID, tgtCompID, password);
                        if (!_validateLogon(sndCompID, tgtCompID, password))
                        {
                            logger.Info("Não foi possivel autenticar sessao acceptor");
                            QuickFix.FIX44.Logout logout = new QuickFix.FIX44.Logout();
                            logout.Set(new Text("This 4.4 session was not authorized"));
                            Session.SendToTarget(logout, s);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                errormsg += ex.Message;
                logger.Error("FromAdmin: " + ex.Message, ex);
            }
        }
Ejemplo n.º 2
0
 public void OnMessage(QuickFix.FIX44.Logout logoff, SessionID sessionID)
 {
     Console.WriteLine("Logout");
 }