简体   繁体   中英

Running Multiple Services Over net.pipe in WCF

I am building a distributed application that will require 6 different services. I will have to demo the application on my XP laptop using Visual Studio 2008.

Is it possible to run multiple services on localhost at the same time, all using net.pipe?

For example:

net.pipe://localhost/DirectoryService
net.pipe://localhost/MathService

If not, is there any other way to host these WCF services without using IIS/webdev server? net.tcp? Something else?

Yes, providing the binding addresses are unique. The two examples you've shown will work fine with the net.pipe binding.

Keep in mind the net.pipe binding will only work on the local machine. If you want your services to be accessible from remote machines, you'll need to use a different binding, such as net.tcp. That said, net.pipe is the recommended binding to use if your services run on the localhost because it is more efficient that the other bindings.

Another thing you should know about net.pipe addresses is that you are providing a URN , not a URL. net.pipe is an in-memory implementation and the "address" you are specifying can be anything.

net.pipe://IHateCats
net.pipe://NamedPipes/Are/Fast

These will all work, regardless of any other factor. It's just the unique identifier for that named pipe. The network stack is not involved with this form of communication.

You can use HTTP as a service end point without IIS, take a look at the ServiceHost class. That's what I use for local WCF tesing and it works very well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM