简体   繁体   English

为什么一些 WCF 命名为 Pipe 客户端会收到 TimeoutException

[英]Why are some WCF Named Pipe clients getting a TimeoutException

I have a WCF name pipe service, to communicate 2 processes on windows.我有一个 WCF 名称 pipe 服务,用于在 windows 上通信 2 个进程。

I've tested it on my machine and it worked, I've developed an installer for it, and it's working for most users, but some users are getting a TimeoutException with this message:我已经在我的机器上对其进行了测试并且它可以工作,我已经为它开发了一个安装程序,它适用于大多数用户,但是一些用户收到了带有此消息的 TimeoutException:

"request operation sent to net.pipe://localhost/myService did not receive a reply within the configured timeout (00:00:10). The time allotted to this operation may have been a portion of a longer timeout. This may be because the service is still processing the operation or because the service was unable to send a reply message. Please consider increasing the operation timeout (by casting the channel/proxy to IContextChannel and setting the OperationTimeout property) and ensure that the service is able to connect to the client." “发送到 net.pipe://localhost/myService 的请求操作在配置的超时 (00:00:10) 内未收到回复。分配给此操作的时间可能是较长超时的一部分。这可能是因为服务仍在处理操作或服务无法发送回复消息。请考虑增加操作超时(通过将通道/代理转换为 IContextChannel 并设置 OperationTimeout 属性)并确保服务能够连接给客户。”

What can be the reason for this error?这个错误的原因是什么? Is it a security issue?是安全问题吗? Where can I set security settings for named pipes?在哪里可以设置命名管道的安全设置?

Thanks谢谢

Some users may not receive a reply in time due to network problems, which may cause a timeout.部分用户可能会因为网络问题没有及时收到回复,导致超时。

You can configure the timeout setting in configuration file by setting the send and receive timeout on binding element.您可以通过在绑定元素上设置发送和接收超时来配置配置文件中的超时设置。

Apply the binding configuration on both service and client-side:在服务端和客户端应用绑定配置:

  <netNamedPipeBinding>
    <binding sendTimeout="00:20:00" receiveTimeout="00:20:00">
     <reliableSession inactivityTimeout="00:20:00"/>
    </binding>
   </netNamedPipeBinding>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM