1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-05 21:07:52 +00:00
conky/remoted.c
Brenden Matthews 73002b6de8 stuff
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@85 7f574dfc-610e-0410-a909-a81674777703
2005-08-08 07:02:35 +00:00

42 lines
968 B
C

/*
* Conky, a system monitor, based on torsmo
*
* This program is licensed under BSD license, read COPYING
*
* $Id$
*/
#include <pthread.h>
static pthread_t daemon;
static int daemon_status = 0;
/* okay, heres how it will basically work.
* when something connects, it will first send the conkyrc on the local (daemonized) server
* after this, it will simply continue to send all the buffered text to the remote client
* http://analyser.oli.tudelft.nl/beej/mirror/net/html/
* http://www.kegel.com/c10k.html
*/
void *daemon_thread()
{
/* do something */
return NULL;
}
static void daemon_loop()
{
/* create thread, keep an eye on it */
int iret;
if (!daemon_status) {
daemon_status = 1;
iret = pthread_create(&daemon, NULL, daemon_thread, NULL);
} else if (daemon_status == 1) {
/* thread is still running, we'll just wait for it to finish for now */
pthread_join(daemon, NULL);
daemon_status = 0;
} else {
/* something else */
}
}