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.