[Quickfix-developers] Faster logons
Brought to you by:
orenmnero
|
From: Brian E. <azz...@ya...> - 2005-11-03 17:39:24
|
I have a new C# FIX application that requires a manual login/logout process. Users need to be able to login to my test server and logout multiple times, so I have two big buttons to do this. The problem is that logging in takes a very long time. The C# version of the library seems to have problems with repeated calls to the threaded initiator's start() and stop() methods, so I start() the initiator at application start up and immediately logout the created session (during the onCreate() callback). I then use the session's logon() and logout() methods to log the session on and off. Logging off is nearly instantaneous, but logging on is generally slow. Looking at the code, both methods simply set the value of m_enabled on the session. Presumably, logging off is quick because next() is constantly being called while a session is active and the m_enabled flag change is being picked up quickly. Logging on, however, can take upwards of 30 seconds. Again, this is presumably because while a session is logged out there is some sort of timeout or delay between checks of the m_enabled flag. Considering that prior to each login, I see the "Connecting to [IP address] on port [#]", it would appear it is some sort of delay prior to spawning the socketThread (the first time) and then the use of m_reconnectInterval and process_sleep (subsequent times). Aside from fixing the .NET code so that initiator start/stop cycles don't cause the code to hang, is there any way of speeding up the logon process? My sneaking suspicion is no, but it doesn't hurt to ask... I would also suggest that the use of process_sleep is a bad idea - whenever I need to code a sleep-type function, I use a mutex and a WaitForSingleObject with the sleep time as the timeout. That way, I can interrupt the sleep (by triggering the mutex) if the reason for the sleep has gone away (or so I don't have to wait 30 seconds to bring my application down if I'm sleeping). Makes things much more responsive. - Brian Erst Thynk Software, Inc. |