[Quickfix-users] RejectLogon
Brought to you by:
orenmnero
|
From: Brian E. <azz...@ya...> - 2005-04-29 19:25:14
|
Oren -
What is the purpose of the "what" string in RejectLogon? I had hoped
that this would be used to send a logout message with a Text field
indicating the reason for the logon rejection - in this way, I could
indicate to my clients that there was a bad username or such, but the
"what" field is actually ignored by the Session::next() exception
handler.
I think it might be really useful to be able to generate a logout
message with a Text field when the "what" field of the RejectLogon is
not empty. The following patch would supply this functionality:
Session.cpp
-01181 catch ( RejectLogon& )
+01181 catch ( RejectLogon& e)
01182 {
01183 m_state.onEvent( "Logon rejected" );
+ if (!e.what().empty())
+ generateLogout(e.what());
01184 disconnect();
01185 }
This way, users that did not want to generate logouts could simply
leave out a reason ("what"), while users that wanted to add a logout
just need to set a non-blank reason.
// No logout
throw FIX::RejectLogon();
// Logout with reason
throw FIX::RejectLogon("Bad username or password.");
What do you think? I attempted to work around the problem by calling
generateLogout() prior to throwing the exception, but generateLogout()
is a private method and I don't really want to modify the QuickFIX
code; it makes upgrading a pain.
- Brian Erst
|