Page 1 of 1

Calling executables - server requests

Posted: Thu Jun 25, 2009 11:26 pm
by masterminder
Hello,

I am looking for the best way to call an executable (written in C++).

In one case I want it to be running as a a demon (server) in order to hold information in memory.
What I did:
1. I created the demon and opened a socket from php to that demon. Done. (In fact I had two demons, one was receiving the request from php and the other executing after being called by the first demon.)

In the other case I would like to simply execute the (C++) program (executable).
1. I did ssh.
2. Socket.
3. exect()

I suppose solution 2. is still the best. Solution 1. is slower and 3. is neither safe not that attractive...

What are your experiences, would you have any suggestions?
It is supposed to hold a big load of requests.

Thanks in advance,
Theo