Request Timeout might not work if WiFi connection was off
See original GitHub issue- I have checked that the [SDK documentation][sdk-docs] doesn’t solve my issue.
- I have checked that the [API documentation][api-docs] doesn’t solve my issue.
- I have searched the [Box Developer Forums][dev-forums] and my issue isn’t already reported (or if it has been reported, I have attached a link to it, for reference).
- I have searched [Issues in this repo][github-repo] and my issue isn’t already reported.
Description of the Issue
When application starts download some relatively big file (around 8Mb) from Box and WiFi connection has been lost or switched off at this moment, timeout exception will never raise and application hangs
Steps to Reproduce
- Run download operation
client.FilesManager.DownloadAsync()
- Wait 2 seconds and switch off WiFi connection
- See error
Expected Behavior
After timeout period (around 100 sec), timeout exception must be thrown
Screenshots
App Example for test:
string ClientId = "my-client-id";
string ClientSecret = "my-secret-id;
string RedirectUri = "https://my-redirect-uri.com/";
var refr = "my-refresh-token;
var acs = "my-access-token";
var session = new OAuthSession(acs, refr, 3600, "bearer");
var config = new BoxConfig(ClientId, ClientSecret, new Uri(RedirectUri));
var client = new BoxClient(config, session);
Console.WriteLine($"Start download {DateTime.Now}");
try
{
var FileId = "my-file-id";
using (var fileStream = new FileStream("MyFile.bin", FileMode.OpenOrCreate, FileAccess.Write, FileShare.Read, bufferSize: 4096, useAsync: true))
using (var stream = await client.FilesManager.DownloadAsync(FileId))
{
await stream.CopyToAsync(fileStream, 4096);
}
}
catch (Exception e)
{
Console.WriteLine($"Exception: {e.Message}");
}
Console.WriteLine($"End download {DateTime.Now}");
Versions Used
Box SDK: 4.4.0 .Net SDK: .Net Framework 4.7.2; .Net 6.0 Windows: 10
Issue Analytics
- State:
- Created a year ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Wifi Connection Timeout - Troubleshooting Guide
A timeout error usually occurs when your WiFi server is taking too long to respond to the data request you've made from your...
Read more >What You Will Learn
#1) Open settings and click on “Network & Internet” as shown in the image below. #2) Click on “proxy” and turn “Automatically detect...
Read more >How to Fix The Ping Error Request Timed Out?
When someone faces problems with network connectivity, the first thing he has to do is to ping the destination address to check the...
Read more >11 Ways to Fix the ERR_CONNECTION_TIMED_OUT Error
Solution 1: Restart Your Internet Connection There's a good chance you'll run into this issue, especially if there's a major internet outage. ...
Read more >Wifi Not Working Properly and Found it Always Request ...
Laptop A does shows "Request Timed Out", but that's only once in a while and one or two occurrences each time it shows...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @23W , you can set this timeout when building a config:
var config = new BoxConfigBuilder(ClientId, ClientSecret, new Uri(RedirectUri)).SetTimeout(TimeSpan.FromSeconds(100)).Build();
It should cause timeout also with no internet connection. Hope this solves your issue. Best, @lukaszsocha2Hi @23W, thanks for submitting this Issue! We will take a look and get back to you ASAP! @lukaszsocha2