Re: [Quickfix-users] Peforming application-specific actions at creation of the initiator thread
Brought to you by:
orenmnero
From: Oren M. <or...@qu...> - 2004-04-23 17:35:53
|
Igor, What is the reason for needing to connect to your database in that thread? Can't you just connect to it before you call start() on the initiator? --oren On Apr 23, 2004, at 11:55 AM, Igo...@ub... wrote: > Hello, > > If I understand correctly, SocketInitiator spawns a separate thread. I > would like to do something at the beginning of this thread, > specifically to > create a database session that I can use in my message handlers called > from > this thread (I wan't a separate session for each thread). However, all > the > interresting looking methods such as onStart, onCreate etc are private > in > SocketInitiator, they cannot be overriden. > > At this stage, I'm thinking of changing onStart to protected in > SocketInitiator.h, creating a class MySocketInitiator derived from > SocketInitiator in which I define onStart as follows: > > void onStart() { > connect_to_my_database(); // my application specific stuff > SocketInitiator::onStart(); > } > > I don't like this solution very much, so is there any better way to > insert > application specific code at the beginning of the socket initiator > thread? > > Regards, > Igor > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > For a limited time only, get FREE Ground shipping on all orders of $35 > or more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg=12297 > _______________________________________________ > Quickfix-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-users > |