查看当前打开的 netNamedPipe 通道?
有什么方法可以确定当前打开哪些 netNamedpipe 通道?这将帮助我调试我的 WCF 客户端/服务器并确保我正确关闭我的通道。
这类似于用于网络连接的 netstat 工具,但用于 netNamedPipes。
Is there any way I can determine which netNamedpipe channels are currently open? This will help me debug my WCF Client/Server and make sure I am closing my channels properly.
This is similar to the netstat tool for network connections, but for netNamedPipes instead.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
据我所知,没有工具可以做到这一点。
您可以使用 Process Explorer 查找进程所持有的命名管道对象的句柄,但这并不能真正回答您的问题。要识别为 WCF NetNamedPipeBinding 通道创建的管道,您需要知道您正在寻找什么。 WCF 管道将在其名称中包含 GUID,如下所示:
请参阅此处了解更多信息。
然而,句柄存在的事实本身并不能告诉您有关通道状态的任何信息。对于管道连接有一个 WCF 池机制,因此即使通道正确关闭,也不能保证管道连接本身已被删除并释放句柄(尽管如果您看到一个进程逐渐获取越来越多的句柄,表明通道清理可能存在问题)。
如果您想确认通道是否正在被及时清理,我建议您在详细模式下启用 WCF 跟踪:这将告诉您到底发生了什么。
There is no tool to do this, as far as I am aware.
You can use Process Explorer to find what handles to named pipe objects a process is holding, but this will not really answer your question. To recognise pipes which are created for WCF NetNamedPipeBinding channels you need to know what you are looking for. WCF pipes will incorporate a GUID in their name, looking something like this:
See here for more on this.
However, the fact that a handle exists doesn't per se tell you anything about the state of the channel. There is a WCF pooling mechanism for pipe connections, so even if the channel is properly closed this does not guarantee that the pipe connection itself has been dropped and the handle released (though if you were to see a process gradually acquiring more and more handles that would suggest there might be a problem with channel cleanup).
If you want to confirm that channels are being cleaned-up promptly I would suggest you enable WCF Tracing in verbose mode: this will tell you exactly what is going on.
您可以使用 Process Explorer 查看进程打开了哪些管道:
http://technet.microsoft .com/en-us/sysinternals/bb896653
You can use Process Explorer to see what pipes a process has open:
http://technet.microsoft.com/en-us/sysinternals/bb896653
SysInternals 有一个名为 PipeList 的命令。我相信您可以在这里单独下载该命令:
http://technet.microsoft.com/en -us/sysinternals/dd581625
SysInternals has a command called PipeList. I believe you can download the command separately here:
http://technet.microsoft.com/en-us/sysinternals/dd581625