가 발생합니다. 이미지 스트림을 응답 객체에 출력하고 플러시를 호출 할 때가끔 오류가 발생합니다. 여기에 내가 읽은 것과는 코드 블록Response.Flush를()는 내가 클라이언트의 웹 사이트에 특정 이미지를 처리하기 위해 사용 해요 HttpHandler를이 System.Web.HttpException
var image = Image.FromStream(memStream);
if (size > -1) image = ImageResize.ResizeImage(image, size, size, false);
if (height > -1) image = ImageResize.Crop(image, size, height, ImageResize.AnchorPosition.Center);
context.Response.Clear();
context.Response.ContentType = contentType;
context.Response.BufferOutput = true;
image.Save(context.Response.OutputStream, ImageFormat.Jpeg);
context.Response.Flush();
context.Response.End();
이며,이 예외가 프로세스가 완료되기 전에 클라이언트 연결 해제에 의해 발생하고 세척하는 것이 아무 것도 없습니다. 여기
내 오류 페이지의 출력
System.Web.HttpException: An error occurred while communicating with the remote host. The error code is 0x80070057.
Generated: Mon, 12 Oct 2009 03:18:24 GMT
System.Web.HttpException: An error occurred while communicating with the remote host. The error code is 0x80070057.
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 PineBluff.Core.ImageHandler.ProcessRequest(HttpContext context) in c:\TeamCity\buildAgent\work\79b3c57a060ff42d\src\PineBluff.Core\ImageHandler.cs:line 75
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
context.Response.Flush는 시도에 포장없이 플러시를 수행하기 전에이를 확인하는 방법이 있나요 라인 (75)
에서 떨어진다/블록 잡기.? 다음 줄부터 구현에 개인적으로
그래서, 나는 .IsClientConnected 내 .Flush()와 .END()를 포장하고 내 문제를 생각하십니까 해결 할 수? 고객의 고객은 화면에 오류를 표시하지 않고 ELMAH로부터 매번 이메일을받습니다. 그냥 사소한 성가심이 무엇보다. –
당신은 확실히 체크에 .Flush을 포장 할 수 - .END를 호출하지의 영향에 대해 너무 확실하지 ... 내가 거기 그 이미지를 생성 완료했습니다 전에 사람들이 분리의 원인에 일부 긴 실행중인 프로세스가있을 것 같은데요? –
.IsClientConnected 내부를 래핑하는 것이 동일한 예외를 throw 할 수 있음을 확인할 수 있습니다. 지금 당장 나에게 일어났다. .End()로 고집하기 – Contra