I have a C++ program (Console Application),
I want to be able to access it from the Web,
My problem:
I don't want the program to load every time a user connects to the page (it takes toooo much time),
the program should load once and forever on the server and only a particular function will run whenever a user visits the web-page.
I tried the CGI library for C++, it has to invoke the program every time.
and I checked the web and asked at some forums, no helpful answer.
[NB: Re-writing the code in another language is not an option]
More details:
- The C++ code is written in Visual Studio 6.0,
- The application first loads an English language dictionary into an array of structures (this takes at least two minutes),
(I know that it might seem unwise to load a dictionary in memory instead of keeping it in a database or an xml file, but this is much faster and speed is the most important factor in this, so a solution will have to take this in consideration)
and I have a Doc class,
what I'm doing now, is
Doc *d1 = new Doc("document1.txt");
Doc *d2 = new Doc("document2.txt");
cout << "Result: " << function(d1, d2);
function(d1, d2) takes 1 second to complete.
What eventually has to be done is to have this always running on a web-site,
so instead of the two parameters (the files document1.txt and document2.txt)
there will be two large text boxes on the web-page where documents can be pasted,
and a magical button that will call the function,
and a label that will display the return value of the function.
Of course, when the user will load the page, he/she will not have to wait many seconds for it, everything should be in memory.
Any suggestions for an easy solution?!
THANKS in advance,
Hady