Re: [Quickfix-developers] SocketInitiator.stop() Problem
Brought to you by:
orenmnero
From: openshac <cha...@gm...> - 2011-01-13 09:09:15
|
Ah that sucks that you have to do it like that. I'm using .Net 4.0 and QuickFix 1.0.2447, I'll see how if I can find time to play around with another version of QuickFix and see if it still works. Sorry I couldn't have been of more use. Dominik Brack wrote: > > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > I use .NET 4.0 and QuickFix 1.13.3. The SocketInitiator hangs even when > calling Dispose(). Does it work for you? > For me it only works if I set the initiator to null and call GC.Collect. > > initiator = null; > GC.Collect(); > > But that's not really an elegant way to do it. > > Dominik > > On Wed, Jan 12, 2011 at 3:48 PM, openshac <cha...@gm...> > wrote: > >> QuickFIX Documentation: >> http://www.quickfixengine.org/quickfix/doc/html/index.html >> QuickFIX Support: http://www.quickfixengine.org/services.html >> >> >> _socketInitiator implements IDisposable. Are you calling >> _socketInitiator.Dispose(); ? >> >> If you don't you may have unmanaged resources (LogFiles) that will not be >> cleaned up / released / garbage collected correctly. >> >> The SocketInitiator.Dispose() method looks like it does this for you if >> you >> call it: >> >> void Dispose( bool dispose ) >> { >> if( m_pUnmanaged ) >> { >> stop( true ); >> delete m_pUnmanaged; >> m_pUnmanaged = 0; >> m_application = 0; >> m_factory = 0; >> m_logFactory = 0; >> } >> >> if( dispose ) >> System::GC::SuppressFinalize( this ); >> } >> >> void Dispose() >> { >> Dispose( true ); >> } >> >> >> horus_the_rabbit wrote: >> > >> > Thanks! I'll be sure to try that. Explicit GC calls aren't "nice", but >> > right now my only other option was to disable the test that tests >> > login/logout and that's no less of a ugly thing to do in testing. >> > >> > -Horus >> > >> > dc10 wrote: >> >> >> >> Hi Horus, >> >> >> >> I've been struggling with the same problem. In my case it hangs on >> >> initiator.stop() too and looking in the debugger shows that it is >> hanging >> >> on a thread join in the unmanaged code. >> >> >> >> The only way I've reliably been able to get round this is to logout >> all >> >> the sessions and then set the initiator variable equal to null and >> call >> >> GC.Collect()! >> >> >> >> Truly horrendous and I'm not proud but at least I can work around the >> >> issue for now while i look for a better solution. >> >> >> >> Please let me know how you get on >> >> >> >> >> >> horus_the_rabbit wrote: >> >>> >> >>> Hi Jason, >> >>> >> >>> I was wondering if you ever resolved this or if anyone has a fix. I'm >> >>> having the exact same issue and I'm using tests to drive my >> development >> >>> (TDD) and this is really been annoying me for the past 3 days. >> >>> >> >>> Here's what I do: >> >>> >> >>> public bool logon() { >> >>> try { initiator.start(); } >> >>> catch (ConfigError configError) { >> >>> Console.Write(configError.StackTrace); >> >>> return false; >> >>> } >> >>> return true; >> >>> } >> >>> >> >>> public void logout() { >> >>> initiator.stop(); //HANGS HERE AND STOPS DEBUGGER >> >>> } >> >>> >> >>> When running tests, after my first test succeeds and my second test >> >>> runs, I get this: >> >>> >> >>> Failure invoke test setup method >> >>> QuickFix.ConfigError >> >>> Configuration failed: Could not open body file: >> >>> Logs\FIX.4.2-LCG-FXDD-MKD.body >> >>> Void .ctor(QuickFix.Application, QuickFix.MessageStoreFactory, >> >>> QuickFix.SessionSettings, QuickFix.LogFactory, >> QuickFix.MessageFactory) >> >>> >> >>> >> >>> Any help would be greatly appreciated, as I don't want to make a mock >> >>> obj for this and would rather see it work properly. >> >>> >> >>> >> >> >> >> >> > >> > >> >> -- >> View this message in context: >> http://old.nabble.com/SocketInitiator.stop%28%29-Problem-tp18473551p30652443.html >> Sent from the QuickFIX - Dev mailing list archive at Nabble.com. >> >> >> >> ------------------------------------------------------------------------------ >> Protect Your Site and Customers from Malware Attacks >> Learn about various malware tactics and how to avoid them. Understand >> malware threats, the impact they can have on your business, and how you >> can protect your company and customers by using code signing. >> http://p.sf.net/sfu/oracle-sfdevnl >> _______________________________________________ >> Quickfix-developers mailing list >> Qui...@li... >> https://lists.sourceforge.net/lists/listinfo/quickfix-developers >> > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > -- View this message in context: http://old.nabble.com/SocketInitiator.stop%28%29-Problem-tp18473551p30660461.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |