Re: [Quickfix-developers] .NET stopping and starting initiator
Brought to you by:
orenmnero
|
From: Patrick W. <pw...@ka...> - 2007-10-31 23:23:35
|
Thanks for the replies.
I think I have fixed this (for my own implementation). I discovered that
the CPPMessageStore.m_pUnmanaged was being deleted twice and worked out
that it was due to me obtaining a pointer to the messagestore in my
dotnet class:
public virtual void onLogon(SessionID session_)
{
_messageStore =3D =
Session.lookupSession(session_).getStore();
}
Where _messageStore is defined as follows:
protected QuickFix.MessageStore _messageStore;
When I unload the above class I find that if I call SuppressFinalize the
error goes away:
public virtual void Shutdown()
{
GC.SuppressFinalize(_messageStore);
_messageStore =3D null;
=20
}
If I omit the suppressfinalize the underlying messagestore is double
deleted and the files can remain locked. Note that calling Dispose()
didn't help and the error remained even if I waited a few minutes for
the GC to do its job.=20
Patrick
-----Original Message-----
From: Francis Gingras [mailto:fr...@at...]=20
Sent: Wednesday, 31 October 2007 6:39 AM
To: Patrick Wright
Subject: RE: [Quickfix-developers] .NET stopping and starting initiator
Patrick,
I have had the same problem in various projects (and QF builds) for
years.
Disposing does not help in my case, nor does forcing garbage collection.
I
never figured out how to solve it so if you do please post the
resolution!
Thanks,
Francis
-----Original Message-----
From: Oren Miller [mailto:or...@qu...]=20
Sent: Tuesday, October 30, 2007 12:07
To: Patrick Wright
Cc: qui...@li...
Subject: Re: [Quickfix-developers] .NET stopping and starting initiator
Have you tried disposing the initiator?
--oren
On Oct 24, 2007, at 7:08 PM, Patrick Wright wrote:
QuickFIX Documentation:
http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX Support: http://www.quickfixengine.org/services.html
Hi,
=20
When a socket initiator is stopped the storage files are still
in
use so that starting it again causes an error ('cannot open body file').
I get the problem when using the .NET version of QuickFix 1.12.4
but
I notice that there is at least one other thread asking about this
problem.
Here is the relevant code section copied from that previous
thread:
=20
> settings =3D new SessionSettings(configFile);
> storeFactory =3D new
> FileStoreFactory(settings); logFactory =3D new
FileLogFactory(settings);
> messageFactory =3D new DefaultMessageFactory(); initiator =3D new
> ThreadedSocketInitiator(this, storeFactory, settings,
logFactory,
> messageFactory);
>
>...
> initiator.start();
>...
> initiator.stop();
> initiator =3D null;
> settings =3D null;
> storeFactory =3D null;
> logFactory =3D null;
> messageFactory =3D null;
> ----------------------------------------
=09
> At this point all of the four storage files are still locked
(can't be
> opened in notepad). Forcing garbage collection doesn't help.
=20
My question is:
Has anyone managed to work around/fix this problem?
I am using QuickFix from a .NET 2.0 WinForms app in C#.
=20
Thanks,
Patrick Wright
=20
=09
------------------------------------------------------------------------
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a
browser.
Download your FREE copy of Splunk now >>
http://get.splunk.com/_______________________________________________
Quickfix-developers mailing list
Qui...@li...
https://lists.sourceforge.net/lists/listinfo/quickfix-developers
|