如何使WCF命名管道地址等于WinApi?

编程入门 行业动态 更新时间:2024-10-24 22:20:30
本文介绍了如何使WCF命名管道地址等于WinApi?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我注意到WCF的命名管道地址

I noticed that WCF's named pipe address

net.pipe://localhost/mynamedpipe

和Windows API的

and Windows API's

\\.\pipe\mynamedpipe

不要碰撞.这是为什么?如何使它们指向同一管道?

don't collide. Why is that? How can I make them point to the same pipe?

推荐答案

没有记录的方法.经过几次测试,我得出以下结论:

There is no documented way of doing that. After a few tests I came to the following conclusions:

如果您有WCF服务器和Win32 C ++客户端,则最后一个将以以下格式将第一个地址显示为UUID:

If you have a WCF server and a Win32 C++ client, the last one will see the first one address as a UUID in the following format:

12345678-1234-1234-1234-123456789abc

12345678-1234-1234-1234-123456789abc

这个UUID似乎是随机的,因为每次启动服务器时它都会更改相同的WCF地址.

And this UUID seems random, since it changes for the same WCF address every time the server is started.

我不知道从WCF客户端是否可以看到具有GUID格式地址的Win32 C ++命名管道服务器,但是我敢肯定,如果这样做,则该服务器将必须实现由以下人员使用的文献记载不充分的协议WCF.

I don't know if a Win32 C++ named pipe server with a GUID format address will be visible from a WCF client, but I'm sure that if it does, the server will have to implement the poorly documented protocol used by WCF.

此类协议的文档是对我之前关于此主题的问题.

编辑进一步的研究表明,管道地址存储在FileMapping中.该条目地址依次是NetNamedPipe地址的规范化版本的base64编码的哈希.

EDIT Further research revealed that the pipe address is stored in the FileMapping. This entry address in its turn is a base64 encoded hash of a normalized version of the NetNamedPipe address.

更多推荐

如何使WCF命名管道地址等于WinApi?

本文发布于:2023-11-05 04:52:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1559951.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:管道   地址   WCF   WinApi

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!