[Quickfix-developers] RES: [Quickfix-users] RES: .NET Can not open body file ... unreleasedresource
Brought to you by:
orenmnero
From: Alex <al...@ec...> - 2006-09-05 16:13:22
|
Unfortunately, I can't simple use Logon/Logoff. We are developing an Initiator application that must allow, at any time, reconnection to the Fix Acceptor using a new dynamic generated senderCompID and without restarting the whole thing. To be exact, the senderCompID is negotiate between the client and the server before starting any Fix session between then. When the client receive the negotiate senderCompID, it then create the SessionSettings on the fly and finally start the Fix session. So at the moment, the only solution we've found consists in reinitialize the SocketInitiator... OK, to be honest isn't the only solution. We are working in a new approach consisting in a) the separation of the Initiator engine layer from the main application layer and b) the establishment of a communication channel between then (IPC, TCP or something like that). This will allow us to shut down the Initiator layer (to avoid the "Cannot open body file" exception) without shut downing the application layer. That is, a lot of hard work to only bypass the resource exception. -- Alex Araujo Banif Banco de Investimento -----Mensagem original----- De: Francis Gingras [mailto:fr...@at...] Enviada em: Tuesday, September 05, 2006 12:31 PM Para: 'Alex' Cc: qui...@li... Assunto: RE: [Quickfix-users] RES: .NET Can not open body file ... unreleasedresources Alex, It isn't perfect. That code works for about an hour of continuous start/stop cycles, then QF crashes. I tried other permutations, including socket.Dispose(), but I get the same thing. I have not run any tests yet but I'm now using logon/logoff and never stop the socket in another project. Hopefully it will help. Francis -----Original Message----- From: Alex [mailto:al...@ec...] Sent: Monday, September 04, 2006 18:52 To: qui...@li... Cc: qui...@li... Subject: [Quickfix-users] RES: .NET Can not open body file ... unreleasedresources Francis, I've tried your solution but it seems to not work. Please, can you send me the piece of code where you release/reutilize the SocketInitiator? Thank you! -- Alex Araujo Banif Banco de Investimento -----Original Message----- Greg, This is what I use and it works fine with .NET 1.1 but with 2.0 you'll need the latest sources from CVS. socket.stop(); socket = null; GC.Collect(); GC.WaitForPendingFinalizers(); Francis -----Original Message----- From: Greg Chase [mailto:greg@...] Sent: Saturday, May 06, 2006 14:14 To: Francis Gingras Cc: quickfix-users@... Subject: Re: [Quickfix-users] Re: Re: .NET Can not open bpdy file ... unreleased resources I too am having trouble releasing resources. I'm using VS 2005, C# and .Net 2.0. How should one properly close down an initiator in .Net? The flow of my application is: -------------------------------------- settings = new SessionSettings(configFile); storeFactory = new FileStoreFactory(settings); logFactory = new FileLogFactory(settings); messageFactory = new DefaultMessageFactory(); initiator = new ThreadedSocketInitiator(this, storeFactory, settings, logFactory, messageFactory); ... initiator.start(); ... initiator.stop(); initiator = null; settings = null; storeFactory = null; logFactory = null; messageFactory = null; ---------------------------------------- At this point all of the four storage files are still locked (can't be opened in notepad). Forcing garbage collection doesn't help. Is anyone able to successfully release ThreadedSocketInitiator resources in .Net? Greg On 5/2/06, Francis Gingras <francis@...> wrote: > > > Tom, > > Just so you know, I sent a project to Oren that demonstrates the problem. > > > Francis -- Gregory Chase Managing Partner Chase Capital Management, LLC -- Alex Araujo Banif Banco de Investimento |