首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >WCF命名的管道IO异常-管道已经结束。(109,0x6d)

WCF命名的管道IO异常-管道已经结束。(109,0x6d)
EN

Stack Overflow用户
提问于 2015-01-20 11:23:15
回答 2查看 6.4K关注 0票数 0

我们有一个WCF服务,它在启动时通过Net.Pipes协议调用其他几个服务。调用返回一个字符串列表,no Enum或复杂对象

有时,我们会收到以下异常。

代码语言:javascript
运行
复制
    System.ServiceModel.CommunicationException: There was an error reading from the pipe: The pipe has been ended. (109, 0x6d). ---> System.IO.IOException: The read operation failed, see inner exception. ---> System.ServiceModel.CommunicationException: There was an error reading from the pipe: The pipe has been ended. (109, 0x6d). ---> System.IO.PipeException: There was an error reading from the pipe: The pipe has been ended. (109, 0x6d).
   at System.ServiceModel.Channels.PipeConnection.FinishSyncRead(Boolean traceExceptionsAsErrors)
   at System.ServiceModel.Channels.PipeConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
   --- End of inner exception stack trace ---
   at System.ServiceModel.Channels.PipeConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
   at System.ServiceModel.Channels.ConnectionStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
   at System.Net.Security.NegotiateStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.NegotiateStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   --- End of inner exception stack trace ---
   at System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
   --- End of inner exception stack trace ---

这并不是每次都会发生。我几乎找不到任何关于这个错误的参考资料。

我想知道,为什么会发生这种情况,以及如何预防。

EN

回答 2

Stack Overflow用户

发布于 2015-02-10 11:09:58

一个可能的原因是,当web服务试图执行其工作时,您的应用程序池正在回收。

将其配置为在特定时间运行:

打开IIS管理器。 在“连接”窗格中,展开服务器节点并单击“应用程序池”。 在“应用程序池”页上,选择一个应用程序池,然后在“操作”窗格中单击“回收”。 选择特定时间,并在相应的框中键入希望应用程序池每天循环的时间。例如,类型为上午11:30或晚上11:30

另一个原因可能是您的邮件负载太大。增加服务器端和客户端的连接关闭时间。顺便说一下,超时可能不仅是因为消息大小,而且也是因为系统太忙(CPU处于100%状态,持续一段时间),或者因为启动服务需要花费太多的时间(在这种情况下,预编译可能会有所帮助)。

为应用程序配置跟踪可能有助于诊断问题:https://msdn.microsoft.com/en-us/library/ms733025.aspx

票数 3
EN

Stack Overflow用户

发布于 2015-01-20 11:38:33

为什么会发生这种事?

正如错误已经指出的:在读操作之前管道是关闭的,有机会运行。

如何预防?

别把手柄关上。手柄可以通过以下几种方式关闭:

  • 如果调用Abort()函数。
  • 如果调用Close()函数。
  • 如果调用DuplicateAndClose()函数。
票数 -3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28044133

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档