|
From: Daniel H. <dh...@ta...> - 2008-05-04 00:13:31
|
I am creating a QuickfixJ application that uses a
ThreadedSocketAcceptor. The problem I have encountered is that even
though I call "stop()" on the acceptor, some of the quickfixJ threads
do not finish, and the application continues to run. This only
happens if something happens to connect to the acceptor while the
application is running - if no one connects then the application
finishes gracefully (I believe it is the QF/J Session dispatcher
threads that don't finish).
Specifically my application looks like:
{
SessionSettings settings = new SessionSettings(new
FileInputStream(fileName));
MessageStoreFactory messageStoreFactory = new FileStoreFactory
(settings);
quickfix.LogFactory qfLogFactory = new FileLogFactory(settings);
MessageFactory messageFactory = new DefaultMessageFactory();
Connector connector = new ThreadedSocketAcceptor(this,
messageStoreFactory, settings,
qfLogFactory, messageFactory);
} else {
connector = new SocketAcceptor(this, messageStoreFactory,
settings,
qfLogFactory,
messageFactory);
}
}
connector.start();
this.run();
connector.stop();
}
I am running the application with jrockit and java 6, though I doubt
this is to blame. I realize I can always call "System.exit()" to make
the application finish, but I figure it shouldn't be necessary if
things are working correctly...
Many thanks for any help you can provide!
-Dan
|