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.
Question about client progress callback
Re: Question about client progress callback
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.
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.
-
- Posts: 5
- Joined: Wed Sep 19, 2012 5:54 am
Re: Question about client progress callback
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.
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
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.
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.
-
- Posts: 5
- Joined: Wed Sep 19, 2012 5:54 am
Re: Question about client progress callback
Thanks Jarl.
My current workaround is using another connection call server for interval progress retrieving(1 or 2 seconds) during a long time call.
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
Yep, I thought about suggesting that - glad you got it working.