2010-10-14 147 views
3

我们在HTTP请求得到一个确实少见的错误:这是什么错误? System.Net.InternalException在Net.HttpWebRequest.SetAndOrProcessResponse

System.Net.InternalException: System error. 
at System.Net.HttpWebRequest.SetAndOrProcessResponse(Object responseOrException) 
at System.Net.ConnectionReturnResult.SetResponses(ConnectionReturnResult returnResult) 
at System.Net.Connection.ReadComplete(Int32 bytesRead, WebExceptionStatus errorStatus) 
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult) 
at System.Net.Connection.ReadCallbackWrapper(IAsyncResult asyncResult) 
at System.Net.LazyAsyncResult.Complete(IntPtr userToken) 
at System.Net.ContextAwareResult.Complete(IntPtr userToken) 
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken) 
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) 
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP) 

大约有什么原因你知道吗?或者我们应该忽略它?

+2

我会为你回答这个问题,但我不希望我的代码被用于......邪恶。 – 2010-10-14 13:02:52

+0

没什么大事,只是摧毁了世界:) – 2010-10-15 07:24:30

+0

为你的应用程序获取system.net tracelog。请参阅http://ferozedaud.blogspot.com/2009/08/tracing-with-systemnet.html上的说明。实际的异常是什么?消息说的是什么? – feroze 2010-10-16 19:32:08

回答

0

我不习惯它的异步版本,但这很可能是一个丢失的连接。

+0

尽管我们处理所有的异常,我们是否应该以不同的方式处理这个异常?我注意到HTTP的异步使用可能会导致在随机地方抛出异常。 – 2010-10-14 22:40:39

+0

我不打扰以不同的方式威胁这些例外。请注意,当您不使用同步版本时,客户端断开连接也会导致访问任何响应的异常。 – eglasius 2010-10-15 00:06:28