views:

106

answers:

3

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.
+3  A: 

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?

Alex K.
Good points. It also made me realise that I need to have some control over the speed of the communication process. For instance, a Windows message might be queued and take time to reach its recipient. I will update the o.p. to add this restriction too.I wonder what overhead a db would impose...
sevaxx
A database has some disk read/write stuff and will probably be slow.
Wartin
+5  A: 
  • 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?

Thomas Matthews
AFAIK the other app only receives data from the keyboard. Command-line arguments will not do the trick because the sums need to be fed constantly in real time and the external app must be running already.
sevaxx
+2  A: 

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

Frank Meerkötter