tags:

views:

151

answers:

2

Sometimes it will be a SocketException:

Stack trace:    at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at System.ServiceModel.Channels.SocketConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)

And sometimes it is throwing the following CommunicationObjectAbortedException:

    Stack trace:    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

The behavior is very random. It is going against static calls that generally work.

A: 

What error?

If is one of the WSA error (100053 WSAECONNABORTED, 10054 WSAECONNRESETand friends) it means the underlying IP stack has closed the socket. If is an async IO pending abort 995 ERROR_OPERATION_ABORTED it means a thread that posted an async I/O request has exited and the request was aborted by the OS.

Remus Rusanu
I'm getting the 995. Any suggestions on how to track it down.
Yuriy Faktorovich
I can't really help, it depends on your code and there is also the many layers of WCF in between. The idea is to figure out why a thread that has initiated an asynchronow request has existed. As a general note, never starting an explicit thread and relying always on ThreadPool asynchronous callbacks usually works, because the ThreadPool has sparate threads for I/O and those are not culled if they have pending I/O requests.
Remus Rusanu
You mean debug WCF? My application isn't using multithreading. The call is happing from ASP.NET though.
Yuriy Faktorovich
I'm not an WCF expert and I don't know why would they exit threads with pending I/O. Hopefuly some of the WCF experts here can chime in and give a verdict.
Remus Rusanu
A: 

The class which implements the interface with the ServiceContract on it is only instantiated once and the methods reused. This causes multithreading exceptions which are not passed back to the client and not logged in the event log.

Yuriy Faktorovich