| Author |
How can I know the transfering progress in RMI
|
Jack Deng
Greenhorn
Joined: May 29, 2004
Posts: 23
|
|
I convert a large file to byte array on server side, and transfer it to client side. I want to build a progress indicator,can any one give me some advices, if you can provide sample code, it would be great. or I don't mind to use an alternative other than simply send the whole file's byte array to the client. thanks
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14491
|
|
The same way you'd do it with files. Define an RMI method that returns the amount of data that will be transferred and another RMI function that works like the C file fread/fwrite functions do in other to transfer the data in small chunks. That way, as the chunks come over you can easily calculate how much data remains and plot it on a progress bar and/or print a "% complete" message. You couldn't do this if you attempted to transfer the entire data stream in a single method call, since from the application program's point of view, and RMI call is an atomic operation.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
 |
|
|
subject: How can I know the transfering progress in RMI
|
|
|