首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >QuickFixN具有不调用OnLogout的会话断开事件

QuickFixN具有不调用OnLogout的会话断开事件
EN

Stack Overflow用户
提问于 2018-04-18 21:38:44
回答 1查看 181关注 0票数 1

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

代码语言:javascript
复制
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,我猜它会捕捉到事件?

EN

回答 1

Stack Overflow用户

发布于 2019-02-08 06:50:54

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

代码语言:javascript
复制
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);
        }
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49901230

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档