Needed help in Asynchronous DBus method call using low level APIs
Kuladeep
kuladeep.chowdary at gmail.com
Mon Aug 29 23:39:40 PDT 2011
Hi Thiago Macieira,
Thanks for your valuable reply.. :) I modified my code such that unreferring
of pending object is done in the function which
dbus_pending_call_set_notify( ) will notify i.e function() in the code. but
still there is no luck.. :(
If you wish to receive the reply, you must wait for the reply to arrive
before
you unref the "pending" object. I am no clear about this. waiting in what
sense.. if we are waiting it wouldn't be asynchronous right..!! correct me
if i am wrong. can u share me some sample code if possible..!!?
Thank you..
Bugzilla from thiago at kde.org wrote:
>
> On Monday, 29 de August de 2011 20:02:54 kuladeep chowdary wrote:
>> Hi All,
>>
>> I am new to DBus IPC. I am trying to call a method in server, from client
>> and getting reply asynchronously, using *dbus_pending_call_set_notify( )
>> *API.. But i am failing to get it done. i am testing even for pending
>> call
>> is NULL or not.. but still i am unable to get it.. i suspect before
>> server
>> sends reply, client process is exiting. But i think internally there will
>> be thread running to get the reply message asynchronously, but its not
>> happening. I am bit confused.. :( I am attaching the code(both server.c
>> and
>> client.c). Please help to sort out this issue. some sample code will be
>> very much help full..
>
> Hello
>
> Let's start by addressing the part where you say "there will be thread
> running". There's no call to pthread_create in your code, nor anything
> with
> "thread" anywhere. If you didn't start a thread, there is no other thread
> running.
>
> You're making a wrong assumption that D-Bus has threads in the background.
> It
> doesn't.
>
> In your client.c code, on line 66 you send the call. If the sending
> succeeds,
> you'll set the notify function on line 73. So far so good.
>
> The next step is line 84, where you unref the pending connection. That
> means
> you no longer care about receiving the reply. After that, you exit the
> program.
>
>
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Software Architect - Intel Open Source Technology Center
> PGP/GPG: 0x6EF45358; fingerprint:
> E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
>
>
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
>
>
--
View this message in context: http://old.nabble.com/Needed-help-in-Asynchronous-DBus-method-call-using-low-level-APIs-tp32357305p32362131.html
Sent from the Free Desktop - dbus mailing list archive at Nabble.com.
More information about the dbus
mailing list