-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
area-System.NetdocumentationDocumentation bug or enhancement, does not impact product or test codeDocumentation bug or enhancement, does not impact product or test code
Milestone
Description
.NET Core 2.1.7 on Windows 7 x64
var httpWebRequest = (HttpWebRequest)WebRequest.Create("http://mirror.zetup.net/ubuntu-cd/18.04.1/ubuntu-18.04.1-desktop-amd64.iso");
httpWebRequest.Timeout = 2000;
httpWebRequest.ReadWriteTimeout = 1;
var webResponse = httpWebRequest.GetResponse();
var responseStream = webResponse.GetResponseStream();
int totalBytes = 0, readBytes;
do
{
var buffer = new byte[16384];
readBytes = responseStream.Read(buffer, 0, buffer.Length);
totalBytes += readBytes;
} while (readBytes != 0);Based on the docs I would expect the responseStream.Read() call to time out, but it never does. responseStream.CanTimeout returns false - so at least it's honest!
In this case the entire file (1953349632 bytes) is eventually downloaded, but in a production case we have the server has not closed the connection for nearly a month now and the client (.NET Core 2.0) is still trying to read from it!
ilyalukyanov, joelwkall, Jmales, coderb and hflhhb
Metadata
Metadata
Assignees
Labels
area-System.NetdocumentationDocumentation bug or enhancement, does not impact product or test codeDocumentation bug or enhancement, does not impact product or test code