与命名管道和多个客户端通信?
嗨!
我有一个可以在同一台计算机上的多个实例中运行的应用程序。然后我还有一个较小的程序,在启动时大多数连接到主应用程序的现有实例(在同一台计算机上)。一些数据将被传输以确定较小的程序应该继续与哪个实例通信。
WCF 的命名管道似乎是最佳选择?
如果我做对了,命名管道的工作方式或多或少与我构建服务器/客户端 WCF 应用程序相同。
我看到的问题是如何连接到多个实例?在常规 WCF 应用程序中,您将知道服务的路径,但在这种情况下,可能会有多个路径吗?
我知道新的 WCF 支持某种广播,因此客户端不必使用特定路径,而是可以在网络上侦听并找到要连接的服务。这可以通过命名管道实现吗?
请指教
Hi!
I have a application that can run in multiple instances on the same computer. Then I also have a smaller program that on starup most connect to the existing instances(on the same computer) of the main application. Some data will be transfared to establish what instance the smaller program should coninue to talk to.
Named pipes with WCF seems to be the way to go?
If I got it right the named pipes works more or less the same way as if I was bulding a Server/Client WCF application.
The problem I see is how to connect to the multiple instances? In regular WCF application you will know the path to the service but in this case there coulde be more then one?
I know that the new WCF supports some kind of broadcasting so the clients do not have to use a specific path but can instead listen on the net and find the service to connect to. Is this possible with named pipes?
Pleas advice
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您正在谈论 WCF 发现,但如果我没有理解错的话,您似乎需要更接近 RoutingService 的东西: http://msdn.microsoft.com/en-us/library/ee517422.aspx
这样,您就拥有了该服务的单一路径( RoutingService)适用于所有客户端,并且 RoutingService 负责将调用重定向到其路由表中配置的正确服务(此配置可以在运行时更改)。关于 RoutingService 的精彩文章可以在这里找到:
http://weblogs.thinktecture.com/cweyer/2009/05/whats-new-in-wcf4-routing-service---or-look-ma-just-one-service-to- talk-to.html
问候
I think you are talking about WCF discovering, but if I don't get you wrong it seems you need something closer to the RoutingService: http://msdn.microsoft.com/en-us/library/ee517422.aspx
With that you have a single path to the service (the RoutingService) for all your clients and it's responsibility of the RoutingService to redirect the calls to the right services configured in its routing table (this configuration can be altered at runtime). A great article about RoutingService can be found here:
http://weblogs.thinktecture.com/cweyer/2009/05/whats-new-in-wcf4-routing-service---or-look-ma-just-one-service-to-talk-to.html
Regards
我们目前正在设计一个类似的系统。
我们计划的方式是:
We are currently designing a similar system.
The way we plan to do it is: