Download TimeOut

Hello, I have another problem with the wyUpdate. This time I'll be more careful and I won't tell you that the problem is in your updater 🙂. First, I will explain my arhitecture: We have 3 components in our system: 1. Client application written in vb6. 2. NT Service written in .NET. 3. Server application that processes updates and based on some audience gives some updates to clients.

First 2 components are installed in the customer network and the server application is in our network. The client won't update if NT Service is not updated. The NT Service is responsible of downloading updates (from our server application) based on its version (a matrix of versions, but this is not important). So, clients will update from the NT Service (has an endpoint that makes this service a web server) which has the updates downloaded from our server application (over internet).

CLIENT----->NT SERVICE-------->SERVER APP installed in out network

Now, if one client needs the file all.to.xxxxx.wyu we have a problem. We don't want to download the all.to.xxxx.wyu file for all clients (this is a big file). In order to solve this problem, we invented a workaround overloading the read method of the stream.

When a client asks for all.to.xxxx.wyu file, we return a "ProxyStream" that contains the exact number of bytes (as all) but all 0.

return new ProxyStream(new Byte[wyuALLfileSize]);

On the Read method of the ProxyStream we have:public override int Read(byte[] buffer, int offset, int count){ byte[] proxyBuffer = method_that_download_file_chunk_from_our_server(fileName,position,count); proxyBuffer.CopyTo(buffer, 0); return proxyBuffer.Length;}

If we have a good connection between the client network and our network everything works fine. But, if the client downloads this file with 2kb/s(a very poor connection) we get timeout. The timeout occurs in your code:

downloadData.response = req.GetResponse(); ---> in the HttpWebRequest you have the default timeout - 100 s.downloadData.GetFileSize();

First I want to ask you if you have another propose for this request. The main idea is that we have a service on the client network that caches the updates (downloaded from the internet) and we don't want to cache the all.to.xxxx.wyu file.

If no, could we parametrize the timeout value? The simplest solution is on the main args of wyUpdate. Maybe I'm wrong, but I think you have this problem even if you try to download an update on a poor internet connection (download 10Mb with 2Kb/s).

Thank you very much.

Now, if one client needs the file all.to.xxxxx.wyu we have a problem. We don't want to download the all.to.xxxx.wyu file for all clients (this is a big file). In order to solve this problem, we invented a workaround overloading the read method of the stream.

Why not just exclude the file altogether? File -> Properties -> Update & server files, then uncheck "Create a catch-all update for corrupt installations":

[attachment=0]no-catch-all.png[/attachment]

Hello, I don't want to remove the all.to.xxxx.wyu file from the update. I just want to download (cache in the NT Service) this file when I need it. We have clients that try to modify some files from our application (delete, change, modify, etc.)

But, don't you have the same problem on poor internet connections?

Thank you.

But, don't you have the same problem on poor internet connections?

No, a timeout means that wyUpdate went a long time without receiving a single byte. This means the internet connection is so bad it might as well not exist. We've tried limiting the download speed of our test server to less than 1KB/s and it still works fine (it takes forever, but it doesn't time out).

Maybe the problem was introduced with your proxy function -- I'm still not sure why you would "0" out the contents of the file. This doesn't make sense to me. wyUpdate will respond to a zeroed out update file with an error. Thus you might as well throw an HTTP error and save yourself some time.

If you're interested in caching files locally, then install a proper proxy caching server on your intranet. There are a thousand different commercial & open source offerings of proxy servers.

Hello,

>>"If you're interested in caching files locally, then install a proper proxy caching server on your intranet. There are >>a thousand different commercial & open source offerings of proxy servers."

Because this "cache" is installed on our clients. I can't install proxy servers for all clients.

>>"Thus you might as well throw an HTTP error and save yourself some time.">>Is there a way on telling wyUpdate, wait xx seconds and ask me again?

"No, a timeout means that wyUpdate went a long time without receiving a single byte. This means the internet connection is so bad it might as well not exist. We've tried limiting the download speed of our test server to less than 1KB/s and it still works fine (it takes forever, but it doesn't time out)."I understand. So, definitely, the error occurs in our code, but I don't understand where.

>>"Maybe the problem was introduced with your proxy function -- I'm still not sure why you would "0" out the >>contents of the file. This doesn't make sense to me. wyUpdate will respond to a zeroed out update file with an >>error. Thus you might as well throw an HTTP error and save yourself some time."Because, I don't have the bytes yet. wyUpdate ask for all.to.xxx.wyu file. I say, ok, take this stream (an empty stream but with the exact length as the wyu file). In the way tcp/ip is designed, a packet cannot be more than 64Kb. So, the tcp/ip protocol will read packets of 64 Kb from my stream. Each time the read function of the stream is called, I read a packet from our servers and serve to wyUpdate. I didn't find any other method to download locally the all.to.xxx file just WHEN and IF I need it.

If you lost time with me debugging this problem I felt compelled to explain you why I am doing this:)

It was a misunderstanding of the timeout property. Now, I am sure that the problem occurs in our code.

Thank you for your answer.