Untrappable System.Net.Sockets.OverlappedAsyncResult.CompletionPortCallback exception

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
 
R

Ram P. Dash

Me again,

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

Nick Baldwin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top