Reputation: 3135
I am generalising this.
The application has a server and a client. The server has huge data. This data has to be sent to the client and saved to a specified location. For this I am sending the data chunk by chunk. I am expecting that the client the UI freezes.
To make UI responsive, I am planning to use a background thread. The idea is On button click, the client will ask the server to get the size of the data to read. Once the size of the data is available, I have to ask the server to send the chunk. Once the data arrives and client writes to a file, then server has to send the next chunk.
This has to continue until last type sent.
I wanted to know how this can be done.
Upvotes: 1
Views: 1186
Reputation: 50672
This allows you to use a server side stream to be controlled (not fully) by a client.
Read this on WCF big data transfers too
Upvotes: 3