Why are named pipes local?
I remember using Named Pipes for communicating between 2 machines (back in Windows NT). How come now I read that Named Pipes are only for Inter Process Communication in the SA开发者_运维技巧ME machine? (in Vista and Windows 7)
Named pipes as an OS infrastructure are totally available for between-machine communication - see the MSDN docs on Named Pipes.
Named pipes can be used to provide communication between processes on the same computer or between processes on different computers across a network. If the server service is running, all named pipes are accessible remotely. If you intend to use a named pipe locally only, deny access to NT AUTHORITY\NETWORK or switch to local RPC.
However, I assume you might be talking about the WCF binding "NetNamedPipe" which indeed is on-same-machine-only communication. Why that's the case is something you'd have to ask the WCF design team - I don't have any information on that.
But as Stephen C rightfully says - if you need machine-to-machine communication (in WCF), use the netTcpBinding instead - the two are fairly similar in their capabilities and their speed and feature set.
See this article on the support added in .NET 3.5 for named pipes.
Marc
Because if they were non-local they'd be called Sockets.
EDIT: actually, that is a rather a flippant, UNIX-centric answer. On UNIX, a named pipe is for local communication only. By contrast, sockets can be used for both local and non-local communication, and can use a variety of transport protocols. Another difference is in the way that you find them. Named pipes are typically found in the filesystem namespace. Sockets (or more precisely, the socket end points) are identified by a network address of some kind which is typically looked up in some kind of name server / service.
精彩评论