views:

517

answers:

2

Hi,

I am currently working on a small project, where I need to send a potentially large file over the internet.

After some debating I decided to go with the streaming option instead of a chunking approach. The files can potentially be very big, I don't really want to specify an exact upper bound, 2GB maybe 4GB, who knows.

Naturally this can take a long time. Again I don't really want to have a timeout. It just takes as long as it takes, doesn't matter.

While poking around trying different files of varying size, I slowly, step by step, tuned the properties of my BasicHttpBinding. I am just wondering if the values I came up with are basically okay, or if they are totally evil?

transferMode="Streamed"
sendTimeout="10675199.02:48:05.4775807"
receiveTimeout="10675199.02:48:05.4775807"
openTimeout="10675199.02:48:05.4775807"
closeTimeout="10675199.02:48:05.4775807"
maxReceivedMessageSize="9223372036854775807"

This just doesn't feel right somehow, these are just the maximum possible values for each underlying data structure. But I don't know what else to do.

So again:

Is this basically the right approach? Or did I completely misunderstand and misuse the framework here?

Thanks

+2  A: 

Well, a more natural approach might be to send the file in a sequence in mid-size chunks, with a final message to commit; this also makes it possible to resume from error. There is perhaps a slight DOS issue with fully open numbers...

Marc Gravell
A: 

I already have a problem with streaming when the connection between WCF client and server goes through the VPN. If interested, read more in this thread.

If the stream is big enough to be streamed for more then a minute - an exception occurs.

dnk.nitro