[Quickfix-developers] Best way to logout and disconnect a client
Brought to you by:
orenmnero
From: Gunnar H. <gh...@hi...> - 2013-06-13 11:48:28
|
Hello, We have an acceptor type application and sometimes we wish to logout and disconnect a client of our app. What is the best way to do this? Now we have the code that is below and it seems to work. But our code does not call methods on the Session's m_state member as does Session itself when sending logout messages (I would like to do the same but m_state and also methods like genrateLogout() from Session class are private). Could our implementation lead to issues eg. when client reconnects later etc.? Logout and disconnect a client: if (MFIXSession != NULL) { if (MFIXSession->receivedLogon()) { FIX42::Logout message; message.set(text); FIX::Session::sendToTarget(message, MFIXSessionID); } MFIXSession->disconnect(); return true; } else { ... } Thanks, Gunnar Harms HiQ Invest Herengracht 442 1017 BZ Amsterdam |