D-Bus Asyn. method call implementation problem

John (J5) Palmieri johnp at redhat.com
Wed Apr 9 20:18:07 PDT 2008


On Tue, 2008-04-08 at 15:14 +0530, sumeet.pawnikar at wipro.com wrote:
> Hello,
>  
> We are working on D-Bus over Ubuntu Linux.
> 
> We have implemented the Asynchronous method using D-Bus. 
> 
> Client Application calls the Async. method over D-Bus to Server. 
> 
> Client has registered the Callback functin for this Async. method.
> 
> In our case, when Client calls this Async. method of Server & after
> being called this Async. method at Server side, Server is doing some
> work for long time.
> 
> So, observed that during this time interval, the registered callback
> function at Client side is automatically called after some fixed
> time slot and recieved some garbage values ( instead of expected some
> logical values ).
> 
>  
> 
> Can you please guide us on how can this problem be resolved?
> 
> Thank you in advance. 

There is an default 25 second timeout.  You can increase this timeout if
you wish but make sure you know worse case.  If you can't predict how
long a call will take a generally accepted pattern for long running
calls is to return a call id immediately and then when the processing is
done, send a signal to client with the call id and results.    

BTW I'm guessing you are processing errors like you process messages.
To handle errors using the lowlevel C api you need to use the error
methods to first check every message to see if it is an error.  If you
are using the python bindings always process errors in a separate error
callback.  Never assign the callback and error callback as the same
function unless you know what you are doing (and even then there is a
reason why we make you specify both). 

-- 
John (J5) Palmieri <johnp at redhat.com>



More information about the dbus mailing list