Catty
Catty

Reputation: 466

Executing daemon process on server

I have one deamon process which listen to the request from user and respond back.

While working on local system I execute it on terminal ./daemon. When user make request ./client from php page(executed by shell_exex() command) daemon process respond which some results. This is ok.

now I want to place this on ftp server. Php page whichc execute daemon process on button click event.

How could I make daemon process to keep listening on server continously? see daemon is c++ executable file.

One this is everytime I first execute shell_exec(daemon) but then purpose is lost. I want some way daemon process continously keep listening for the request!

Upvotes: 0

Views: 366

Answers (1)

nouney
nouney

Reputation: 4411

Use daemon(), it does exactly what you want. If this function is not available on your system, take a look at this tutorial which explains you how to rewrite the function.

Upvotes: 1

Related Questions