简体   繁体   English

QuickFIX / n未连接

[英]QuickFIX /n Not Connecting

I have a implementation of QuickFIX/n that I have given to a client. 我已经将QuickFIX / n的实现提供给了客户端。 It connects to the Currenex RFQ system. 它连接到Currenex RFQ系统。 They experience a issue when the start up the application occasionally. 他们偶尔启动应用程序时会遇到问题。 No errors are getting thrown, and it works fine in my testing. 没有错误被抛出,并且在我的测试中工作正常。 The only way they can successfully get it to connect is to restart their entire server. 他们成功连接的唯一方法是重新启动整个服务器。

I have no idea why this is happening and it doesn't thrown any errors. 我不知道为什么会这样,并且没有引发任何错误。 I have my entire fix connection wrapped in a try|catch statement, so I don't know what else I could be missing. 我的整个修复程序连接都包裹在try | catch语句中,所以我不知道还有什么可能丢失。 Below is my connect method. 下面是我的连接方法。 The code executes and all the logging is hit, but the logon message is never sent. 该代码将执行并且所有日志记录都将被命中,但是登录消息永远不会发送。

I'm at my wits end and so is our client, any pointers would be a huge help. 我尽全力以赴,我们的客户也一样,任何指点都会有很大帮助。

Code: 码:

public void Connect()
    {
        try
        {
        string beginString = "FIX.4.2";
        MemoryStoreFactory storeFactory = new MemoryStoreFactory();
        MessageStoreFactory msgFactory;
        LogFactory logfactory;
        SessionSettings settings = new SessionSettings();
        QuickFix.Dictionary entry = new QuickFix.Dictionary();

        entry.SetString("ConnectionType", "initiator");
        entry.SetString("ReconnectInterval", "1");
        entry.SetString("SocketConnectHost", this.fixHost);
        entry.SetString("FileLogPath", this.workingDirectory + "logs");
        entry.SetString("FileStorePath", this.workingDirectory + "logs");
        entry.SetString("StartTime", "23:59:59");
        entry.SetString("EndTime", "23:59:59");
        entry.SetString("HeartBtInt", "30");
        entry.SetString("SocketNodelay", "Y");
        //entry.SetString("SocketTrafficClass", "IPTOS_LOWDELAY");
        entry.SetString("ResetSeqNumFlag", "Y");
        //entry.SetString("UseDataDictionary", "N");
        entry.SetString("DataDictionary", this.workingDirectory + "FixResourceFiles\\FIX42.xml");
        entry.SetString("ResetOnLogout", "Y");
        entry.SetString("ResetOnDisconnect", "Y");
        entry.SetString("CheckLatency", "N");
        entry.SetString("SocketConnectPort", this.fixPort);

        this.sessionId = new QuickFix.SessionID(beginString, this.senderCompId, this.targetCompId, DateTime.Now.ToString("yyyyMMddhhmmssfff"));

        settings.Set(this.sessionId, entry);

        if (this.storeAllQuickFixMsgs)
        {
            logfactory = new FileLogFactory(settings);
        }
        else
        {
            logfactory = new ScreenLogFactory(settings);
        }

        msgFactory = new FileStoreFactory(settings);

        Logger.MsgLog("Creating QuickFIX Socket Initiator...");
        QuickFix.Transport.SocketInitiator init = new QuickFix.Transport.SocketInitiator(this, msgFactory, settings);
        //this.socketInitiator = new QuickFix.Transport.SocketInitiator(this, msgFactory, settings, logfactory);
        this.socketInitiator = init;


        Logger.MsgLog("Starting Socket Initiator...");
        this.socketInitiator.Start();
        Logger.MsgLog("Started");

        }
        catch (Exception ex)
        {
            Logger.MsgLog("Error on FIX Connection: " + ex);
        }
    }

Settings: (internal corporate FIX host) CNX i1scfxcrfq 10.192.6.121 444 test1234 设置:(内部公司FIX主机)CNX i1scfxcrfq 10.192.6.121 444 test1234

Check the below two lines: 检查以下两行:

entry.SetString("StartTime", "23:59:59");
entry.SetString("EndTime", "23:59:59");

I guess this is why you might be facing issues. 我想这就是您可能会遇到问题的原因。 The initiator will only start at StartTime. 启动器仅在启动时间启动。 Your client might be starting it at some other time? 您的客户可能会在其他时间启动它?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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