Untrappable System.Net.Sockets.OverlappedAsyncResult.CompletionPortCallback exception

  • Thread starter Thread starter Ram P. Dash
  • Start date Start date
R

Ram P. Dash

Hi,

I've a c# windows service constantly communicating with an ASP.NET web
service. After running for sometime, I am getting the following exception at
the windows service (client):

Object reference not set to an instance of an object.
[Stack Trace: at System.Net.HttpWebRequest.ClearRequestForResubmit()
at System.Net.HttpWebRequest.DoSubmitRequestProcessing()
at System.Net.HttpWebRequest.SetResponse(CoreResponseData
coreResponseData)
at System.Net.ConnectionReturnResult.SetResponses(ConnectionReturnResult
returnResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
at System.Net.Sockets.OverlappedAsyncResult.CompletionPortCallback(UInt32
errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)]

Since this exception doesn't occure in any code block, I can only catch it
by doing the following:
AppDomain currentDomain = AppDomain.CurrentDomain;

currentDomain.UnhandledException += new
UnhandledExceptionEventHandler(DefaultHandler);

In my DefaultHandler, I've the failover code. Even then, the windows service
doesn't fully recover. All the static variables (reference types) in the
class just loose their referrence.

What's going on?

Thanks,
Ram
 
Me again,

Too bad I can't swallow UnhandledException. The application will die, no
matter what.
 
Usually, by the time AppDomain.UnhandledException is raised, the
application is doomed. In default handler, you can see if the error is
fatal by checking the "IsTerminating" bool of the
UnhandledExceptionEventArgs.

Something is being reset to null, or a reference is being lost. Does the
stack trace go down any farther? And does it give you the property name
it's talking about?
Me again,

Too bad I can't swallow UnhandledException. The application will die, no
matter what.


Hi,

I've a c# windows service constantly communicating with an ASP.NET web
service. After running for sometime, I am getting the following exception
at the windows service (client):

Object reference not set to an instance of an object.
[Stack Trace: at System.Net.HttpWebRequest.ClearRequestForResubmit()
at System.Net.HttpWebRequest.DoSubmitRequestProcessing()
at System.Net.HttpWebRequest.SetResponse(CoreResponseData
coreResponseData)
at System.Net.ConnectionReturnResult.SetResponses(ConnectionReturnResult
returnResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
at
System.Net.Sockets.OverlappedAsyncResult.CompletionPortCallback(UInt32
errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)]

Since this exception doesn't occure in any code block, I can only catch it
by doing the following:
AppDomain currentDomain = AppDomain.CurrentDomain;

currentDomain.UnhandledException += new
UnhandledExceptionEventHandler(DefaultHandler);

In my DefaultHandler, I've the failover code. Even then, the windows
service doesn't fully recover. All the static variables (reference types)
in the class just loose their referrence.

What's going on?

Thanks,
Ram
 
Back
Top