Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF - Setting Timeout on Large File Download

Tags:

c#

wcf

I've written a pair of applications, using WCF for a client/server connection between them. Part of the functionality is that the client will download (potentially very large) files across WCF. Everything works fine.

I'm using basicHttpBinding, and have my sendTimeout and receiveTimeout set to a couple of minutes. The trouble I have is, if I set my timeouts to be smaller, then they don't allow enough time for a large file download (especially across a slow network). If I leave the timeouts as is, then I have to wait a long time when I get a dropped connection.

Is there a better way for me to deal with this issue, that still allows me to download the files over WCF?

EDIT: In addition to the answer from luksan, I found a lot of useful information on this previous post: Timeouts WCF Services

like image 517
HaemEternal Avatar asked Dec 07 '25 01:12

HaemEternal


1 Answers

Have you tried setting the SendTimeout to a large value and leaving the ReceiveTimeout as is? I think SendTimeout times out a long-running operation whereas ReceiveTimeout times out an inactive channel.

like image 68
luksan Avatar answered Dec 08 '25 14:12

luksan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!