|
|
|
|||||
|
How can I get the percentage of file transfer
I write the slice like this:
bool getFile(string filename); The server get the file from a remote machine and return true or false when transfering completed. I don't know how to send messages to the client when transfering. How can I get the percentage of file transfer when the client invoking this function? Can you help me? |
|
|||||
|
I try to use Ice::Stats,but I dont' think it works well.
Thanks for your help! I write a client and a server using Ice::Stats.I found that the Ice::Stats only get the bytes sent and recevied between client and server.But it does not meet my requirement.There are my client and server in the accessories.
My develop environment:winxpsp2 vc2005 Ice3.3.0 In my project,clients and server works like this: 1、The client invokes function getFile, and this returns true or false.True means the server get the file from the other computer success,false means some error occurs. 2、The server get the file by socket or by seriport,and send percentage to client.Return true or false at the end.(The problem is how to send messages to the client and how to receive messages from the server.) 3、The client doesn't get the file from the server in fact,but only needs to get informations the server happenning. My English is poor,so I don't know if you understand what I mean.Thanks. |
|
||||||
|
I would use some callback interface to do this. You could do something like this:
Code:
interface TransferFileCallback
{
void transferred(float f); // Percentage transferred between 0 and 1.
void failed(string reason); // Transfer failed.
};
interface TransferFile
{
// Returns true if the file will be transferred, false otherwise.
bool getFile(string filename, PercentageCallback* cb);
};
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| transfer file with Ice | zhongshiz | Help Center | 4 | 10-23-2007 10:00 PM |
| File transfer and threading. | EmmanuelOga | Help Center | 3 | 08-15-2006 10:41 AM |
| Any Example that do file transfer out there | alexm | Help Center | 2 | 04-06-2006 06:31 PM |
| How can I develop a File transfer application?question 1 | xiehua | Help Center | 11 | 12-05-2003 11:39 PM |