Saturday, March 11, 2006 - Posts

NetLimiter and Remoting, a match made in hell!

For a while now I have been getting an unexplained error message during the course of my application and despite a global exception catch this one seems to slip through.  Unfortunately I couldn't ever debug this particular problem so decided to run my application in console mode and came out with the following error:

Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at System.Net.UnsafeNclNativeMethods.OSSOCK.WSAGetOverlappedResult(SafeCloseSocket socketHandle, IntPtr overlapped, UInt32& bytesTransferred, Boolean wait, IntPtr ignored)
   at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

This only ever seemed to happen when a client remoting connection was ceased (by the termination of the client process) but it was the server that would be crashing.  Immediately my thoughts turned to WinFX Feb CTP which I had recently installed but after careful delving I discovered that NetLimiter wasn't behaving itself, causing .NET 2 to not behave itself.  After uninstalling NetLimiter everything seemed to work fine and hopefully I can continue to develop my software. 

I wonder why the Remoting system falls over so badly based on an external 3rd party problem?