This is a continuation of my previous question: Download file in chunks
Right now, I have a working application, that allows to download and play large media files. However, there's still a problem left. As I've noticed, if the download time is more than five minutes, the connection is closed, because of timeout. That's not a problem, because the app can easily reopen it, send another request, e.t.c.
Now, that's a problem: There can be several types of errors with the response, but I can't divide the "timeout expired" exception(if I catch this one, I use the method, that will continue downloading) from the other exceptions, that are really caused by errors. They all have type of WebException. I also tried the solution from this article, but the ex.Status
value is "unknown error"(!). The message value is also equal "The remote server returned an error: NotFound."
So, my question is simple: how to define that the error is caused by timeout?