如何连接两个应用程序

发布于 2024-09-02 04:31:03 字数 410 浏览 7 评论 0原文

我正在考虑用 C++ 构建一个应用程序,它将解析来自网络的文本并创建一些统计结果。我希望将这些结果实时输入到外部应用程序中。然后,外部应用程序(我无法访问其代码,但可以要求付费定制添加)将需要一些代码来读取和使用这些结果。

我想知道在速度和易于实施方面互连这两个应用程序的最佳方式是什么。我在考虑:

 disk I/O (slow) 

 a Windows service  

 a DLL  

 a web service  

 a web page

也许我缺少更好的解决方案?谢谢。

Update : there is an additional need to know how long a data request may take at worst.

I am considering building an app in C++ that will be parsing text from the web and create some statistical results. These results I want to be fed in an external app in real time. The external app (to whose code I have no access, but can ask for a - paid - custom made addition) will then need some code to read and use these results.

I am wondering what would be the best way to interconnect the two apps, in terms of speed and ease of implementation. I am considering :

 disk I/O (slow) 

 a Windows service  

 a DLL  

 a web service  

 a web page

Perhaps I am missing a better solution ? Thank you.

Update : there is an additional need to know how long a data request may take at worst.

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

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

发布评论

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

评论(3

椒妓 2024-09-09 04:31:03
  • 插座?
  • 共享内存?
  • 内存盘?
  • TCP/IP?
  • Windows 消息?
  • (其他应用程序的)命令行参数?

其他应用程序有什么方法来支持接收数据?

  • Sockets?
  • Shared Memory?
  • RAM Disk?
  • TCP/IP?
  • Windows Messages?
  • Command line arguments (of the other application)?

What methods does the other application have to support receiving data?

_失温 2024-09-09 04:31:03

Windows 服务是明智的,但仍然需要与其他应用程序通信,这称为 IPC,描述了 Windows 上的方法 这里,命名管道很简单&灵活,文件映射功能强大。

另一种选择是在中间放置一个数据库?

A windows service would be sensible but would still need to communicate with the other app, this is called IPC, approaches on windows are described here, Named Pipes are simple & flexible, File Mapping is powerfull.

An alternative would be to stick a database in the middle?

狼亦尘 2024-09-09 04:31:03

有多种 IPC 机制可供选择(套接字、共享内存、管道……)。我想“最佳选择”在很大程度上取决于其他应用程序的结构。您的自定义扩展将花费您多少费用。

我对你的环境不太了解,但可能值得看看 boost.interprocess:
http://www.boost.org/doc/libs/ 1_43_0/doc/html/interprocess.html

There are a number of IPC mechanisms to choose from from (sockets, shared memory, pipes, ...). I guess the "best choice" will depend to a large extend on how the other application is structured aka. how much your custom extension will cost you.

I don't know much of your environment but it might be worthwhile to have a look at boost.interprocess:
http://www.boost.org/doc/libs/1_43_0/doc/html/interprocess.html

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