简体   繁体   中英

Quickfix/N the callbacks ToApp ToAdming is not trigering in Initiator

I created simple quickfix application:

 public static void Main()
    {
        SessionSettings settings = new SessionSettings("C:\\Users\\user\\Desktop\\Work\\QFLib\\config\\Config2.txt");
        MyQuickFixApp myApp = new MyQuickFixApp();
        IMessageStoreFactory storeFactory = new FileStoreFactory(settings);
        ILogFactory logFactory = new FileLogFactory(settings);
        var acceptor = new SocketInitiator(
            myApp,
            storeFactory,
            settings,
            logFactory);
        bool sendlogon = true;
        acceptor.Start();
        while (true)
        {
            if(sendlogon)
            myApp.SendLogonRequest(myApp.session.SessionID);
            sendlogon = false;
            Thread.Sleep(1000);
        }
        acceptor.Stop();
    }

}

The problem server is not getting requests, and not sending response. The configs looks okay and generated message also looks good. I also sending generated message via TCP client and in that case on server I get parse error and no response. The config file: Config file The logs: logs

As Cristoph John answered I didn't need to send logon. I just needed to add code to autologin:

public void ToAdmin(Message msg, SessionID sessionID) 
    {
        Console.WriteLine("ToAdmin " + msg);
        if (msg.GetType() == typeof(QuickFix.FIX44.Logon))
        {
            msg.SetField(new Password("Password"));
            msg.SetField(new ResetSeqNumFlag(true));
        }
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM