1

在 QF 事件日志中有会话层事件:

20180418-13:30:51.268 : Connection failed: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond #.#.#.#:#
20180418-13:31:00.288 : Connecting to #.#.#.# on port #
20180418-13:31:21.293 : Connection failed: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond #.#.#.#:#
20180418-13:31:00.288 : Connecting to #.#.#.# on port #

用于报告/响应这些事件的事件处理程序是什么?OnLogout处理程序没有被调用。

我不想使用FromEarlyIntercept我猜想会抓住事件?

4

1 回答 1

2

这种行为是设计使然 - 没有建立连接,没有完成登录,因此OnLogout连接时网络故障后没有事件。您可以查看该部分的源代码 -FromEarlyIntercept在这种情况下也不会触发。ReconnectIntervalQuickFix/n 只记录错误并在几秒钟后尝试重新连接。

try
        {
            t.Connect();
            t.Initiator.SetConnected(t.Session.SessionID);
            t.Session.Log.OnEvent("Connection succeeded");
            t.Session.Next();
            while (t.Read())
            { }
            if (t.Initiator.IsStopped)
                t.Initiator.RemoveThread(t);
            t.Initiator.SetDisconnected(t.Session.SessionID);
        }
        catch (IOException ex) // Can be exception when connecting, during ssl authentication or when reading
        {
            t.Session.Log.OnEvent("Connection failed: " + ex.Message);
        }
        catch (SocketException e) 
        {
            t.Session.Log.OnEvent("Connection failed: " + e.Message);
        }
于 2019-02-07T22:50:54.413 回答