Dieser Code-Streams von großen Dateien für unsere Nutzer:"Der Remote-Host hat die Verbindung geschlossen" in Response.OutputStream.Write
// Open the file.
iStream = new System.IO.FileStream(filepath, System.IO.FileMode.Open,
System.IO.FileAccess.Read, System.IO.FileShare.Read);
// Total bytes to read:
dataToRead = iStream.Length;
// Read the bytes.
while (dataToRead > 0)
{
// Verify that the client is connected.
if (Response.IsClientConnected)
{
// Read the data in buffer.
length = iStream.Read(buffer, 0, 10000);
// Write the data to the current output stream.
Response.OutputStream.Write(buffer, 0, length);
// Flush the data to the HTML output.
Response.Flush();
buffer = new Byte[10000];
dataToRead = dataToRead - length;
}
else
{
//prevent infinite loop if user disconnects
dataToRead = -1;
}
}
Jedes Mal eine Weile wir erhalten diese Ausnahme:
The remote host closed the connection. The error code is 0x80072746
hier ist der vollständige Stack-Trace:
Stack Trace:
at System.Web.Hosting.ISAPIWorkerRequestInProcForIIS6.FlushCore(Byte[] status, Byte[] header, Int32 keepConnected, Int32 totalBodySize, Int32 numBodyFragments, IntPtr[] bodyFragments, Int32[] bodyFragmentLengths, Int32 doneWithSession, Int32 finalStatus, Boolean& async)
at System.Web.Hosting.ISAPIWorkerRequest.FlushCachedResponse(Boolean isFinal)
at System.Web.Hosting.ISAPIWorkerRequest.FlushResponse(Boolean finalFlush)
at System.Web.HttpResponse.Flush(Boolean finalFlush)
at System.Web.HttpResponse.Flush()
at System.Web.HttpWriter.WriteFromStream(Byte[] data, Int32 offset, Int32 size)
at System.Web.HttpResponseStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at BIS.DocumentBus.Controls.DocumentViewer.StreamFile(String filepath)
Ich nie Beweise gehabt habe, dass Benutzer Probleme beim Herunterladen von unseren Dateien haben und planen, diese Ausnahme einfach zu ignorieren.
Irgendeine Idee, was die Quelle dieses Problems ist? Ist es sicher zu ignorieren?
Mögliche Duplikate von [Der Remote-Host hat die Verbindung geschlossen. Der Fehlercode ist 0x800704CD] (http://stackoverflow.com/questions/5564862/the-remote-host-closed-the-connection-the-error-code-is-0x800704cd) –