How do I connect two apps
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.
开发者_如何学PythonUpdate : there is an additional need to know how long a data request may take at worst.
- 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?
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?
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
精彩评论