开发者

Why does WCF Restrict us to Only Open a Named Pipe Once per Machine?

What is the reason for opening a named pipe only once per machine? .I mean what is the reas开发者_Go百科on behind this restriction?


I haven't tested this but it makes sense that only one listener can be open on a single named pipe. Allowing two instances of the pipe to be open would create a range of issues, to start with:

  1. When we send a message to the service, how do we know which listener is going to accept our message?
  2. Do we really need the overhead of avoiding race conditions when two listeners are trying to receive the same message?
  3. Would we expect each listener to receive the message, or just one?

Keep in mind that allowing two listeners on the same named pipe would allow two completely different services to receive the same messages. There is simply no reason to allow this to happen.

Update
Chris Dickson points out that allowing two listeners on the same pipe creates a security issue known as a squatting attack, where a fraudulent host can receive requests and steal the identity of the caller. This is a ramification of point 1 above.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜