温馨提示:本文翻译自stackoverflow.com,查看原文请点击:quickfix - How to permanently disconnect an Acceptor session
quickfix quickfixj

quickfix - 如何永久断开接受者会话

发布于 2020-06-15 15:56:04

是否可以在QuickFIX / J中断开Acceptor会话?我已经尝试过该方法disconnect(String reason, boolean logError)但是,一旦对方尝试重新连接,则会话将重新连接。

我要保持联络

查看更多

提问者
Muhammadh Aadhil
被浏览
29
Christoph John 2020-03-30 18:06

根据该disconnect()方法的javadoc注释,您不应该从用户代码中调用它:

     * This method should not be called from user-code since it is likely
     * to deadlock when called from a different thread than the Session thread
     * and messages are sent/received concurrently.
     * Instead the logout() method should be used where possible.

因此,请使用该logout()方法从会话中注销。它还将禁用会话,以使对方在连接时注销。但是登录的时间可能很短。这是因为该标志仅每秒检查一次。

要立即拒绝登录,可以RejectLogonfromAdmin()回调中抛出异常