[Dbus-cxx-users] catching exceptions / problems with repeatedly calling methods
Status: Beta
Brought to you by:
rvinyard
|
From: camillo s. <cam...@gm...> - 2010-07-13 08:06:31
|
Hi there,
I'm starting to develop a distributed application using dbus-cxx-0.7.0. In
principle things work quite well, however when digging a bit deeper I run
into the following problems where up to now neither the examples shipped
with the project nor goggling around provided me an answer.
First I'd like to properly handle the case of calling a method-proxy in my
test-client without the server running. To do so I enclosed the proxy call
with a try-catch block like this
> * int setTimerRel(int pid, int timerId, long initDelay, long deltaT, int
> repCount)*
> * {*
> * try*
> * {*
> * cout << "CTSMProxy setTimerRel" << endl;*
> * return (*m_methodSetTimerRel)(pid, timerId, initDelay, deltaT,
> repCount);*
> * }*
> * catch (exception &e) { cerr << "exception: " << e.what() << endl;
> return -1;}*
> * catch (...) { cerr << "caught something else" << endl; return -1; }*
> * }*
>
When this method is called without the server running I always run into the
catch(...) block which provides me no information about the exception. I
also tried to add a third catch-block using one of the dbus-cxx provided
Error classes, however to no avail which is obvious since these classes
derive from std:exception which is caught neither. Are there some examples
how to proceed there correctly ?
The second problem I run into is when (with server running now) I repeatedly
issue proxy-calls in a loop, say up to 10 times. Then some calls work fine
but then a timeout occurs and the proxy returns again with the catch(...).
How about to handle such stress scenarios in an orderly way?
Thx + regards
camillo
|