RTC Forums
November 24, 2024, 07:01:05 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Remote Function - Receive Progress  (Read 4206 times)
Ryan
RTC Expired
*
Posts: 15


« on: June 26, 2012, 11:59:17 AM »

Hi all,

I've been putting together my first RTC application and all has gone well so far. I have been using remote functions to handle data going to and from the server. Most functions return small amounts of data but I have one function which will return a new application if the version on the clients PC is out of date. There only thing I haven't been able to work out is how to get a progress bar to show the receive progress from the server.

In my client program I have a RtcHttpClient connected to a RtcClientModule. All functions are prepared and executed. I've looked at the OnResponseData event of the RtcHttpClient component but I can't seem to find a content length value. Only counters for the total amount received and the amount of data that has just been read. Any tips would be gratefully received.

Take care,
Ryan
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: June 26, 2012, 09:02:45 PM »

As a rule of thumb, if you need to display the progress when receiving a single result from a single remote function call, it means that you are using remote functions for something they were not meant to be used for.

For sending and/or receiving large files (or huge amounts of data), especially if there is a requirement for a progress bar indicating the status of a transfer, you should be using TRtcDataProvider (Server side) and TRtcDataRequest (Client side) components, which provide you with all the events needed to implement what you want and give you full control over the transfer.

For simple examples of a Server providing access to its files by using the TRtcDataProvider component, please check the Quick Start Server Lessons 3 and 4 in the Quick Start guide HERE. Source code for Server Lessons is also available in the "QuickStart" folder of the RTC SDK. For a more complex example, check the "File_Server" and/or "RtcWebServer" Projects in the "Demos" folder.

For a simple example of a Client downloading files from a Server by using the TRtcDataRequest component, please check the Quick Start Client Lesson 1 in the Quick Start guide HERE. For a more complex Client example, check the "File_Client" Demo, which is located in the "Demos" folder of the RTC SDK. The "File_Client" demo also shows you how to implement a progress bar when using the "TRtcDataRequest" component.

Best Regards,
Danijel Tkalcec
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.024 seconds with 17 queries.