Added Timeout option in MyWebClient class for the WebRequest #726
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, I added a static property Timeout to the AutoUpdater class to configure the timeout in milliseconds for web requests made by WebClient, with a default value of 100,000 ms.
The GetWebClient method now sets the Timeout of the MyWebClient instance to AutoUpdater.Timeout. The MyWebClient class also includes a new Timeout property and the GetWebRequest method has been overridden to use this value.
The reason is because by default WebRequest timeout sometimes is not enough to establish connection to the http server, as commented in this issue #489.
However, this could be a temporary solution because of #676.
We tested it under local conditions, but you are free to test it in more scenarios. Sometimes, it still shows the WebClient request error when intentionally disconnecting from the internet and reconnecting. It only waits for the timeout but does not resume the download,
possibly due to the way WebClient works...Edit: It looks like our HTTP server is closing the connection with the client at the moment it loses internet connection. So, the issue is on our side. Testing it with the AutoUpdaterTest project works fine.Closes #489
Saludos 😄 🇲🇽