Page 1 of 1

Question about client progress callback

Posted: Tue Oct 30, 2012 9:15 am
by bladewhistle
In my application, some times client call the server with a complex mission will cost several seconds. It is necessary to provide a callback function mechanism to display a progress UI at client side.

In the manual, I see there are some description about the client progress callback.

But there are no description about how to update the progress from the server side.

Any code or example?

Thanks.

Re: Question about client progress callback

Posted: Tue Oct 30, 2012 11:51 am
by john06
This is not really related to RCF, RCF is supporting callback, and this is up to you to define what your callback(s) is giving you !
In your case you should define something like:
"typedef void (* _ProgressProc)( float percent );" which is defined on client side (for example to display a progress bar), where percent argument is the % calculated on server and sent back to client.
and _ProgressProc is an argument of the function defined on server side that you call from client.

Re: Question about client progress callback

Posted: Wed Oct 31, 2012 12:52 am
by bladewhistle
Hi, Thanks for your reply.

Are you sure the RCF really support the C++ native callback?? Since I don't see any description in the documentation.

Re: Question about client progress callback

Posted: Wed Oct 31, 2012 5:43 am
by jarl
Currently the purpose of the RCF client side progress callback is to periodically return control to the application, while a synchronous call is in progress. From the progress callback you can do things like cancel the call (for example if the app wants to shut down), repaint UI's , show progress bars, or anything else you might want to do.

What bladewhistle is asking for, IIUC, is the ability to send progress indicators back from the server, during a remote call, and utilize that in the client side progress callback. This is currently not supported, but IMO that's a a great feature - I will make it a priority for upcoming releases.

Re: Question about client progress callback

Posted: Mon Nov 05, 2012 3:00 am
by bladewhistle
Thanks Jarl.

My current workaround is using another connection call server for interval progress retrieving(1 or 2 seconds) during a long time call.

Re: Question about client progress callback

Posted: Mon Nov 05, 2012 3:33 am
by jarl
Yep, I thought about suggesting that - glad you got it working.