Is it possible to have a C++ program running on a server that sits and waits to be passed arguments by a PHP process.
The C++ program would then process these arguments and return a result to PHP.
I’ve been searching the web and can see a couple of ways to run a C++ program from PHP but can’t find a way to interact with a C++ program that is already running.
The sort of C++ programs I’m thinking of are ones that might take time to set up e.g. They create a big data structure of some kind and so I don’t want to run them every time I need them. I want the C++ programs to create their data structures and then sit back and wait until asked by PHP for information from that data structure.
Thanks
Use named pipes.
https://web.archive.org/web/20140223054156/http://my.opera.com/zomg/blog/2007/08/29/php-and-named-pipes
and
C++ https://web.archive.org/web/20110926155246/http://ist.marshall.edu/ist480acp/namedpipes.html