Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   How to develop program to run as daemon? (http://www.go4expert.com/forums/develop-program-run-daemon-t3699/)

gubak 31Mar2007 22:50

How to develop program to run as daemon?
 
Hi!

I have been debeloping in C++ Builder.
I want to develop an email alerter program for windows machine. This program will start at startup and every 5 seconds will ask the mail server for the new messages. If new message comes the email alerter program will start an animation.
I want it to run in daemon mode (work in background and listening new messages), but I have no idea how to do this. Maybe with an endless cycle? I think it's not very good idea.

Do you have any other idea how to develop a program to run in daemon mode?


Thank you

DaWei 1Apr2007 04:07

Re: How to develop program to run as daemon?
 
You either do it, or you don't. In the first case, it is a (albeit, possibly smalll) hit on performance. If this is a valuable hit, go for it. If not, fugeddaboudit.

boldyman 1Apr2007 04:11

Re: How to develop program to run as daemon?
 
On windows a daemon is called "windows service".
Take a look at the MSDN:
http://msdn2.microsoft.com/en-us/library/8dy6h580(VS.80).aspx

Good luck!

DaWei 1Apr2007 07:15

Re: How to develop program to run as daemon?
 
A Windows service is an example of a daemon, or daemon-like operation. A daemon, such as is triggered by some interrupt, particularly a real-time interrupt, can run entirely outside the purview of any operating system that happens to be installed. One who is not intimately familiar with systems and their OS skins is courting potential disaster.


All times are GMT +5.5. The time now is 13:41.