|
Questions on the service implementation in Ice 1.3
Dear forum,
The thing I've been waiting for the most was the service implementation in the new version.
It's a rather elegant implementation, so thanks a lot!
What I tried at first was an implementation independent of Ice, i.e. simply writing some random stuff to a file.
What I discovered was that, when I compiled the program in debug mode (VS 7.0), I get an error _CrtCheckMemory(), i.e. in the malloc debugger. I hope that this error isn't created by me and you'll be able to reproduce it. If not, I would re-create my simple example.
btw: When compiling in release mode, everything works really smooth!
An other question that arised when taking a look at the service implementation: Before I was using the standard Ice::Application interface and had a while() loop (checking for interrupted() periodically) which called some functions on my server object which need to be called periodically as well. As I now only have a start() function I can overwrite and no run() function, what is your suggestion for doing periodic calls to an object from within a service? I created a separate thread in start() which does the job for me but I asked myself whether you have a better idea!
regs,
Stephan
P.S.: One suggestion for the next releases: Can't you please implement two pure virtual functions to the interface of Ice::Service named serviceLabel() and serviceName() which need to be overwritten for implementations? This would simplify the call to
myservice.exe --install "servicelabel"
to
myservice.exe --install
since the name of the service is 'known' by the implementation!
This would be similar to the implementation that Trolltech chose within the Qt solutions library (http://doc.trolltech.com/solutions/qtservice/qtservice.html )
|