Running Multiple Services Over net.pipe in WCF

守給你的承諾、 提交于 2019-12-07 09:22:52

问题


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?


回答1:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/749756/running-multiple-services-over-net-pipe-in-wcf

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!