开发者

Can I use a named pipe binding in a WCF service that supports multiple clients?

开发者 https://www.devze.com 2023-03-25 06:57 出处:网络
I have been doing some reading in preparation forstarting my first WCF project and have come across this statement in Juval Lowy\'s book(Programming WCF Se开发者_如何学运维rvices):

I have been doing some reading in preparation for starting my first WCF project and have come across this statement in Juval Lowy's book(Programming WCF Se开发者_如何学运维rvices):

In WCF, services that use IPC can only accept calls from the same machine. Consequently, you must specify either the explicit local machine name or localhost for the machine name, followed by a unique string for the pipe name:

net. pipe: //localhost/MyPipe

You can open a named pipe only once per machine, so it is not possible for two named pipe addresses to share a pipe name on the same machine. I

Does this mean that I can only have one client connection per endpoint if I use a named pipe binding?


No, you can have multiple connections. A pipe is similar to a TCP connection: the server has an address (IP + port), and multiple clients can connect to it (with their own IP + port). You can have as many quadruples <SIP, SPort, CIP, CPort> as the server can handle. A similar thing happens with pipes - the server pipe name will be unique (based on the name), but the client "endpoint" has a different name (likely a Guid), and it's the pair <SName, CName> which needs to be unique, so you can have <SName, CName1>, <SName, CName2>, <SName, CName3>, ...


You can only have one host per endpoint but you can have multiple client connecting to the same endpoint.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号