[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] Runnking MHD_deamon for infinite amount of time
From: |
Sebastian Gerhardt |
Subject: |
Re: [libmicrohttpd] Runnking MHD_deamon for infinite amount of time |
Date: |
Sat, 11 Apr 2009 19:02:41 +0200 |
Hello,
you could have the parent threat wait for a signal, for
example SIGHUP. See the manual for GNU libc, "waiting for a signal".
On Fri, 2009-04-10 at 12:17 +0530, arnuld uttre wrote:
> I am working with libmicrohttpd and I have looked at the
> minimal_example.c which uses this model:
>
> d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_DEBUG,
> atoi (argv[1]),
> NULL, NULL, &ahc_echo, PAGE, MHD_OPTION_END);
> if (d == NULL)
> return 1;
> sleep (atoi (argv[2]));
> MHD_stop_daemon (d);
>
>
>
> I want to tun MHD_deamon continuously just like httpd server keeps on
> listening for infinite amount of time, no matter whether some browser
> sends it the request or not, which is what a daemon does, keep on
> runnig nt he background forever. I have 2 options:
>
> 1) don't use sleep() and don't use MHD_stop_daemon() . In that case
> MHD_daemon stops after 1 second.
>
> 2) Pass the UINT_MAX . It will expire after some specific time
>
>
> Is there anyway that using select initernally can I keep on running
> the daemon for infinite amount of time ?
>
>
>