开发者

What's the difference between named pipe and mailslot (mailbox)?

开发者 https://www.devze.com 2023-03-31 03:56 出处:网络
It seems these 2 IPC mechanisms are very similar with each other, is there any difference be开发者_如何学编程tween them?I think the introductions to each mechanism on MSDN answers this:

It seems these 2 IPC mechanisms are very similar with each other, is there any difference be开发者_如何学编程tween them?


I think the introductions to each mechanism on MSDN answers this:

  1. Mailslots:

    A mailslot is a mechanism for one-way interprocess communications (IPC). Applications can store messages in a mailslot. The owner of the mailslot can retrieve messages that are stored there. These messages are typically sent over a network to either a specified computer or to all computers in a specified domain.

  2. Named Pipes:

    A named pipe is a named, one-way or duplex pipe for communication between the pipe server and one or more pipe clients. All instances of a named pipe share the same pipe name, but each instance has its own buffers and handles, and provides a separate conduit for client/server communication

So:

  • Named pipes are connection orientated, mailslots are not.
  • Mailslots can be used for broadcast, named pipes cannot.

(Summary: mailslots are rather like UDP, but named pipes are closer to TCP. The 424 byte limit of mailslots between computers is even more limited than UDP packets on normal networks.)

While both mailslots and named pipes can have ACLs (limiting what actions different client users can do), named pipes also allow delegation of client's identity so the server can act (access other resources) as that user (or be blocked).

(Edited to correct information on security, and note mailslot message size limit.)


Mailslots dont have definite ACL based permissions as in named pipe. It is not possible to block specific set of users from accessing mail slot. Source windows security book.

0

精彩评论

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

关注公众号