是否有某种方法可以将网络数据同时定向到两个应用程序?

发布于 2024-12-07 11:31:31 字数 285 浏览 0 评论 0原文

我正在开发一个应用程序,用于处理通过互联网传输的实时数据。我想用它做两件根本不同的事情:一件极其简单但至关重要的是它永远不会被中断。另一个更复杂但中断并不是一个可怕的问题。鉴于第二个应用程序由于其复杂性而崩溃的风险更高......我问是否有某种方法可以同时接收数据源?

我可以在一个应用程序中同时拥有这两个功能,但如果它崩溃了,那就非常糟糕了。我在想,通过将两个功能分离到两个应用程序中,它可能为关键的简单处理提供更强大的处理。

但是如果我分成两个应用程序,它们是否可以同时接收相同的数据?某种类型的操作系统网络巫毒之类的?

I'm developing an application that processes a real time data feed across the internet. There are 2 fundamentally different things I want to do with it: one extremely simple but critical that it never is interrupted. Another much more complex but interruption is not such a horrible problem. Given that the second would have higher risk of the application crashing due to its complexity... I'm asking if there is some way that both can be receiving the data feed at the same time?

I could have both functions in a single application but if it crashes, that's very bad. I was thinking by separating the two functions into two applications, it might provide more robust handling for the critical simple processing.

But if I separate into two applications, is it possible for both of them to receive the identical data at the same time? Some type of OS networking voodoo or something?

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

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

发布评论

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

评论(1

鼻尖触碰 2024-12-14 11:31:31

这取决于流以及您想要实现它的方式 - 实现您所描述的内容的一些一般想法:

  • 制作一个接收器应用程序
    这的唯一目的是接收提要并将其分派给任何注册接收的应用程序/消费者...如果接收应用程序位于同一系统上,您可以使用共享内存(例如.NET中的MemoryMappedFile),这非常快...这将有助于满足未来的需求 - 例如,如果您需要实现另一个处理应用程序,它只需要向接收器应用程序注册...另一个很好的副作用:接收器应用程序可以捕获某些持久性的提要,从而允许出于测试目的“重播”等等

  • 使“关键”的一个多路传输
    这意味着只有您的关键应用程序会接收提要并将副本发送到其他应用程序(例如在不同的线程上)

It depends on the stream and on the way you want to implement it - some general ideas to achieve what you describe:

  • make a receiver app
    this has the only purpose in receiving the feed and dispatching it to any apps/consumers who register to receive... if the receiving apps are on the same system you can use shared memory (MemoryMappedFile in .NET for example) which is really fast... this would help regarding future requirements - for example if you need to implement another processing app it just needs to register with the receiver app... another nice side-effect: the receiver app can capture the feed to some persistence and thus allow a "replay" for testing purposes etc.

  • make the "critical" one multiplex the feed
    this would mean only your critical app receives the feed and sends a copy to the other app (for example on a different thread)

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