在net.pipe:// localhost /没有端点监听

时间:2021-08-05 09:19:59

I have two WCF services hosted in a single Windows Service on a Windows Server 2003 machine. If the Windows service needs to access either of the WCF services (like when a timed event occurs), it uses one of the five named pipe endpoints exposed (different service contracts). The service also exposes HTTP MetadataExchange endpoints for each of the two services, and net.tcp endpoints for consumers external to the server.

我在Windows Server 2003计算机上的单个Windows服务中托管了两个WCF服务。如果Windows服务需要访问任一WCF服务(例如发生定时事件时),它将使用公开的五个命名管道端点之一(不同的服务协定)。该服务还为两个服务中的每一个公开HTTP MetadataExchange端点,并为服务器外部的使用者公开net.tcp端点。

Usually things work great, but every once in a while I get an error message that looks something like this:

通常情况下效果很好,但每隔一段时间我就会得到一条看起来像这样的错误信息:

System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at net.pipe://localhost/IPDailyProcessing that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.IO.PipeException: The pipe endpoint 'net.pipe://localhost/IPDailyProcessing' could not be found on your local machine. --- End of inner exception stack trace --- Server stack trace: at System.ServiceModel.Channels.PipeConnectionInitiator.GetPipeName(Uri uri) at System.ServiceModel.Channels.NamedPipeConnectionPoolRegistry.NamedPipeConnectionPool.GetPoolKey(EndpointAddress address, Uri via) at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout) at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade) at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

It doesn't happen reliably, which is maddening because I can't repeat it when I want to. In my windows service I also have some timed events and some file listeners, but these are fairly infrequent events. Does anyone have any ideas why I might be encountering an issue? Any help would be greatly appreciated.

它不会可靠地发生,这是令人发狂的,因为我不能在我想要的时候重复它。在我的Windows服务中,我也有一些定时事件和一些文件监听器,但这些都是相当罕见的事件。有没有人有任何想法,为什么我可能会遇到一个问题?任何帮助将不胜感激。

3 个解决方案

#1


7  

Check if "Net.Pipe Listener Adapter" service is running in Services management console. This is used by WAS to receive any request on named pipe.

检查服务管理控制台中是否正在运行“Net.Pipe侦听器适配器”服务。 WAS使用它来接收命名管道上的任何请求。

#2


0  

I'm not sure whether this is germane to your discussion, because I've never used the .net named pipes, but I do recall that the .net tcp socket endpoints had a known bug that resulted in "endpoints occasionally being terminated for no apparent reason", and unfortunately the official MS response was a "workaround" which involved checking that the socket was still up before sending a message through it, and re-opening it in the case that it wasn't. I'd like to think that the named pipe endpoints aren't as unreliable as the "reliable TCP endpoints", but you might want to look into the "known periodic TCP socket failure" to see whether it also extends to named pipes.

我不确定这是否与您的讨论密切相关,因为我从未使用.net命名管道,但我记得.net tcp套接字端点有一个已知的错误,导致“端点偶尔被终止为no显而易见的原因“,不幸的是,正式的MS响应是一个”解决方法“,其中涉及在通过它发送消息之前检查套接字是否仍处于运行状态,并在不支持的情况下重新打开它。我想认为命名的管道端点并不像“可靠的TCP端点”那样不可靠,但您可能希望查看“已知的周期性TCP套接字故障”以查看它是否也扩展到命名管道。

Sorry that this isn't really an answer, and I hate to suggest that you might have to add the inefficiency of checking to ensure that it's up before sending a message, etcetera.

很抱歉,这不是一个真正的答案,我讨厌建议您可能必须添加检查的低效率,以确保在发送消息之前它已经启动,等等。

#3


0  

I got a similar error in past, and, if I remember right, it was something wrong with the data passed to/from service. In my case problem was in data size (I used the WSHttpBinding, so there is a http default limit). The way I found the problem was to add logging in related methods, find the problematic data, and try to reproduce the problem in some debug-friendly environment and make it happen (crash) constantly with data you found.

我在过去遇到了类似的错误,如果我没记错的话,传入/传出服务的数据有问题。在我的情况下问题是数据大小(我使用WSHttpBinding,所以有一个http默认限制)。我发现问题的方法是在相关方法中添加日志记录,找到有问题的数据,并尝试在某些调试友好的环境中重现问题,并使用您找到的数据不断发生(崩溃)。

In my case the exception message was not related to the problem, which sometime happens in WCF.

在我的情况下,异常消息与问题无关,有时在WCF中发生。

#1


7  

Check if "Net.Pipe Listener Adapter" service is running in Services management console. This is used by WAS to receive any request on named pipe.

检查服务管理控制台中是否正在运行“Net.Pipe侦听器适配器”服务。 WAS使用它来接收命名管道上的任何请求。

#2


0  

I'm not sure whether this is germane to your discussion, because I've never used the .net named pipes, but I do recall that the .net tcp socket endpoints had a known bug that resulted in "endpoints occasionally being terminated for no apparent reason", and unfortunately the official MS response was a "workaround" which involved checking that the socket was still up before sending a message through it, and re-opening it in the case that it wasn't. I'd like to think that the named pipe endpoints aren't as unreliable as the "reliable TCP endpoints", but you might want to look into the "known periodic TCP socket failure" to see whether it also extends to named pipes.

我不确定这是否与您的讨论密切相关,因为我从未使用.net命名管道,但我记得.net tcp套接字端点有一个已知的错误,导致“端点偶尔被终止为no显而易见的原因“,不幸的是,正式的MS响应是一个”解决方法“,其中涉及在通过它发送消息之前检查套接字是否仍处于运行状态,并在不支持的情况下重新打开它。我想认为命名的管道端点并不像“可靠的TCP端点”那样不可靠,但您可能希望查看“已知的周期性TCP套接字故障”以查看它是否也扩展到命名管道。

Sorry that this isn't really an answer, and I hate to suggest that you might have to add the inefficiency of checking to ensure that it's up before sending a message, etcetera.

很抱歉,这不是一个真正的答案,我讨厌建议您可能必须添加检查的低效率,以确保在发送消息之前它已经启动,等等。

#3


0  

I got a similar error in past, and, if I remember right, it was something wrong with the data passed to/from service. In my case problem was in data size (I used the WSHttpBinding, so there is a http default limit). The way I found the problem was to add logging in related methods, find the problematic data, and try to reproduce the problem in some debug-friendly environment and make it happen (crash) constantly with data you found.

我在过去遇到了类似的错误,如果我没记错的话,传入/传出服务的数据有问题。在我的情况下问题是数据大小(我使用WSHttpBinding,所以有一个http默认限制)。我发现问题的方法是在相关方法中添加日志记录,找到有问题的数据,并尝试在某些调试友好的环境中重现问题,并使用您找到的数据不断发生(崩溃)。

In my case the exception message was not related to the problem, which sometime happens in WCF.

在我的情况下,异常消息与问题无关,有时在WCF中发生。