[Quickfix-users] Peforming application-specific actions at creation of the initiator thread
Brought to you by:
orenmnero
|
From: <Igo...@ub...> - 2004-04-23 16:58:06
|
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
|