与命名管道和多个客户端通信?

发布于 2024-11-16 19:43:39 字数 385 浏览 2 评论 0原文

嗨!

我有一个可以在同一台计算机上的多个实例中运行的应用程序。然后我还有一个较小的程序,在启动时大多数连接到主应用程序的现有实例(在同一台计算机上)。一些数据将被传输以确定较小的程序应该继续与哪个实例通信。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

帅哥哥的热头脑 2024-11-23 19:43:39

我认为您正在谈论 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

喜你已久 2024-11-23 19:43:39

我们目前正在设计一个类似的系统。

我们计划的方式是:

  • 启动时,客户端将通知服务它们正在运行,并且可以在特定地址接收通知。
  • 当服务器程序需要发送某些内容时,它将查看通知并使用这些地址。

We are currently designing a similar system.

The way we plan to do it is:

  • On start up the clients will notify a service that they are running and can receive notifications at a specific address
  • When the server program needs to send something out it will look at the notifications and use those addresses.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文