0

I am designing a WCF service and client with callback using named pipe, when the server process the request from the client, I got the error#109 and eventually the pipe connection got aborted. Below is the tracing file from the server side. In case the font is too small to see, I should simply explain it:

The three exception marked in red happened when the request made from the client to the server. The function is pretty simple, is passes one string variable to the server. This error is #109 (3 consecutive exceptions, if that number means anything) and it doesn't give more information. And in this activity the pipe connection eventually got aborted. Also what's weird is we can see the next activity after the "Receive bytes on connection...", the "Processing message", it actually went through, meaning the server side processing did get called with the passed parameter. This can be verified in the debugger because on the server side the operation did get the passing string. Also inside the operation function if I try

Dim callback = OperationContext.Current.GetCallbackChannel(Of ISSLServiceCallback)()
If DirectCast(callback, ICommunicationObject).State = CommunicationState.Opened Then 
   DoSomething()
End If

It actually goes into the If sentence, which I guess means the channel is actually alive so far.

Thanks for any help!

Tracing details

4

2 回答 2

0

此异常意味着服务器端 WCF 通道堆栈遇到了操作系统错误ERROR_BROKEN_PIPE 109 (0x6D) The pipe has been ended。这表明当服务来写响应或与回调通道交互时,您的客户端可能已经断开连接。

我确实知道 NetnamedPipeBinding 中 ERROR_BROKEN_PIPE 的一个原因是客户端和服务器各自的绑定配置之间的安全期望不匹配的某种模式 - 我建议您检查安全配置以确保双方的一致性。

如果您需要更多帮助,请发布您在日志跟踪中看到的每个异常的客户端和服务代码、端点配置和堆栈跟踪以及其他详细信息。

于 2012-06-18T15:56:38.063 回答
0

我知道这是一个旧线程,但我遇到了完全相同的问题。

原来客户端代理是这样关闭的:

client.Abort();
client.Close();

..而不是类似的东西:

try
{
    client.Close();
}
catch (Exception ex)
{
    client.Abort();
}

.. 它消除了 WCF 跟踪文件中的所有错误。

于 2016-06-23T11:43:02.467 回答