![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Sep 2005
Location: Oopland
Posts: 36
Rep Power: 0
![]() |
Building a Daemon
I was wondering if anyone had any information or links for buildings daemons. Any information is appreciated
|
|
|
|
|
|
#2 |
|
Programming Guru
![]() |
What would you like to know, how to start a program in deamon mode?
[php] #include <stdio.h> #include <stdlib.h> int main(Int argc, char *argv[]) { pid_t daemon = fork(); if(daemon < 0) { fprintf(stderr, "Could not for process...\n"); exit(EXIT_FAILURE); } else if(daemon == 0) exit(EXIT_SUCCESS); // Start program here... return EXIT_SUCCESS; } [/php]
__________________
|
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() ![]() |
If you want a client/server environment... I suggest reading this:
http://beej.us/guide/bgnet/
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#4 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
Tempest's example is only the first step to daemon-izing a program.
http://www.linuxprofilm.com/articles...mon-howto.html If you want a Windows daemon, then I would suggest running it as a service. MSDN has a lot of resources on the subject. Dameons are better anyway. ![]()
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|