1

I am designing a WCF service with callback using named pipe binding. And when I call the service from the client, on the server side tracing it shows the error "There was an error reading from the pipe: Unrecognized error 109" and eventually the pipe connection got aborted. But I have absolutely no clue what caused the problem. The tracing doesn't give more information except the stack trace:

System.ServiceModel.Channels.PipeConnection.OnAsyncReadComplete(Boolean haveResult, Int32 error,   Int32 numBytes)
System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

and another 109 error with stack trace

System.ServiceModel.Channels.PipeConnection.OnAsyncReadComplete(Boolean haveResult, Int32 error, Int32 numBytes)

I suspected it has something to do with the return value of the operation based on the tracing activities flow. But even if I declare return type of the operation as void, I still get this error. Another thing is although I am using callback, but it doesn't call the callback inside the operation.

Any help will be appreciated, or guide me on how to debug the pipe connection aborted, I bet there is some way to get more verbose information. For example how to catch the exception mentioned above(try catch block inside the server operation doesn't get anything, neither does the client side calling function).

tete
  • 4,859
  • 11
  • 50
  • 81

2 Answers2

1

Turned out I didn't call the client.Close() function in some stage. So when the client program exit, the channel got aborted and the server showed the mentioned error

tete
  • 4,859
  • 11
  • 50
  • 81
0

Oversized messages can cause this error. Are you sending lots of data from the client?

I think I've also had it when I was sending an enum, but the value wasn't a valid enum value.

Also some very useful info here about tracking down the problem.

GazTheDestroyer
  • 20,722
  • 9
  • 70
  • 103
  • Thanks for your reply. I also learned that either oversided reply or enum value might cause this problem. At first I was returning an enum, but now I changed it to return bool (as I mentioned I even changed the function as void, but still got this problem). Another thing is on your link, it said the client side got the 109 error, while in my case I got it on the server, without any other useful info like what he had such as serialization error. I believe the failing reason was reported in some exception, but I just don't know where to catch it. – tete Mar 30 '12 at 11:08