How to develop program to run as daemon?

Discussion in 'C' started by gubak, Mar 31, 2007.

  1. gubak

    gubak New Member

    Joined:
    Mar 31, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  2. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    http://www.daweidesigns.com
    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.
     
  3. boldyman

    boldyman New Member

    Joined:
    Mar 27, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Home Page:
    http://www.nextdawn.nl
    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!
     
  4. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    http://www.daweidesigns.com
    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.
     
    Last edited: Apr 1, 2007

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice