Hi @StewartBW ,
It's generally not a good practice to use On Error Resume Next
as it suppresses all errors, making it hard to debug issues. Using Try...Finally
to ensure that resources are disposed of correctly, and called the base class's Dispose
method in the Finally
block.
The ideal timeout value depends on several factors, including the expected response times, network conditions, and the nature of the operations.
For small, quick operations, use shorter timeouts (e.g., 5-10 seconds).
For large file downloads/uploads, use longer timeouts (e.g., 1-3 minutes).
For applications where user interaction and quick feedback are critical, favor shorter timeouts and handle retries or error messages gracefully.
The following are the timeout periods that can be referenced.
OpenRead: If the resource is expected to respond quickly, a timeout of 10-15 seconds is reasonable.
UploadValues: Depending on the size of the data being uploaded, a timeout of 20-30 seconds is usually sufficient.
DownloadStringAsync,DownloadString: For small to medium-sized responses, a timeout of 10-20 seconds is typically adequate. the exact value can be adjusted based on expected response sizes and network conditions.
DownloadFileAsync: For large files, the timeout should be longer. A range of 1-2 minutes is usually reasonable for typical file sizes.
Best Regards.
Jiachen Li
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.