进程间通信/广播

发布于 2024-08-16 05:16:31 字数 206 浏览 14 评论 0原文

我有一个 Windows 服务(用 C# 实现)和一个类似服务控制管理器的东西。我想跟踪从服务到服务控制管理器(这是一个窗口窗体应用程序)的消息,但我不确定执行此操作的最佳方法是什么。该服务应将消息广播给以非阻塞方式列出的所有客户端。

我考虑过使用命名管道或邮槽,但我不确定是否有更好的方法来做到这一点(我也不确定是否可以用这项技术实现广播)。

任何建议将不胜感激。

I have a Windows Service (implemented in C#) and I have something like a service control manager. I would like to trace messages from the service to the service control manager (which is a window forms application), but I'm not sure what's the best way for doing this. The service should broadcast the messages to all clients who are listning in a nonblocking manner.

I have considerd using named pipes or mailslots, but i'm not sure if there is a better way for doing this (I'm also not sure if I can implement the broadcating with this technology).

Any advice would be greatly apreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

请恋爱 2024-08-23 05:16:31

如果有多个客户端正在监听,我认为命名管道会需要更多工作。我认为对于这种情况,共享内存会更简单。如果客户端可能位于单独的计算机上,并且不涉及大量数据,那么诸如多播之类的东西可能是传输信息的简单方法。然而,多播范围通常仅限于单个子网,除非路由器专门配置用于多播。

If there are multiple clients listening, I think named pipes would be a little more work. I think shared memory would be simpler for that situation. If the clients might be on a separate machine, something like multicast might be a simple way to transmit the information if there is not a lot of data involved. However, multicast range is typically limited to a single subnet unless the routers are specifically configured for multicast.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文