Find the answer to your Linux question:
Results 1 to 2 of 2
Hi everyone, I found loads of stuff out there to help me create a daemon in C, PHP or Python and I would like to get some advice on the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2011
    Posts
    1

    Create daemon


    Hi everyone,

    I found loads of stuff out there to help me create a daemon in C, PHP or Python and I would like to get some advice on the best solution to select for my specific goal.

    I'm a web developer and would like to be able to trigger a refresh action of the page through javascript on the computer I'm using for design testing, that is to say a computer that is not the one I'm editing my code on.

    So I'm looking for a way to tell the distant client from my editor or from the command line that it should reload the page.

    I was thinking to put in my html pages a very small piece of javascript that would make a ajax call on loading and wait asynchronously for a response, reloading the page when this happens.

    What should this script call ? A PHP script run as a daemon that has a kind of event handler waiting also for the command to be sent or daemon written in C, in Python ?

    What do you think

    Thanks in advance

    leothelast

  2. #2
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    I think that AJAX is the correct solution (you certainly need some sort of JS), but you will not be communicating with a daemon. You will be communicating with a web server. The web server will handle the daemon part of the problem.

    So the real part of the problem is how to write a PHP/Perl/Rails/etc. page that your AJAX can call and which will return when you tell it to. You can use pretty much any language for this, and your code can be as simple as checking for the existence of a file, and when that file exists, remove it and return.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •