I have an app that is built using .Net remoting. When authenticating, If there is an error, I threw an exception on the server. The exception is serializable. But when the exception is thrown on the server, Sometimes I see an error on the client side that says "An established connection was aborted by the software in your host machine".
This is the stack trace I have from windbg when try to debug the server. Looks like the remoting framework is doing that. Any ideas as to why the socket is being closed and how to handle this?
System.Net.Sockets.Socket.Close() System.Runtime.Remoting.Channels.SocketHandler.Close() System.Runtime.Remoting.Channels.SocketHandler.CloseOnFatalError(System.Exception) System.Runtime.Remoting.Channels.SocketHandler.ProcessRequestNow() System.Runtime.Remoting.Channels.RequestQueue.ProcessNextRequest(System.Runtime.Remoting.Channels.SocketHandler) System.Runtime.Remoting.Channels.SocketHandler.BeginReadMessageCallback(System.IAsyncResult) System.Net.LazyAsyncResult.Complete(IntPtr) System.Net.ContextAwareResult.CompleteCallback(System.Object) System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) System.Net.ContextAwareResult.Complete(IntPtr) System.Net.LazyAsyncResult.ProtectedInvokeCallback(System.Object, IntPtr) System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32, UInt32, System.Threading.NativeOverlapped*) System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32, UInt32, System.Threading.NativeOverlapped*)
Best Answer
Is it the case that the .Net remoting framework closes the socket everytime a remoting exception is thrown? from debugging using WinDbg, that looks to the case. Could some one confirm this? Also, Is it the case some times the socket is closed after the reponse is sent and sometimes the socket is closed before the response is sent depending on an particular scenario?
This is trace from windbg on the client side when I don't get that "An established connection was aborted by the software in your host machine". In this case, I get a remoting exception
This is the trace when I get that error "An established connection was aborted by the software in your host machine". In this case I get a socket error.
And the one that is throwing the exception on the server is our custom sink that takes care of security. I could have posted the code If it as in one place and straight forward.