RSS Git Download  Clone
Raw Blame History
/*******************************************************************************
 *	Control.cc	Control process
 *			T.Barnaby,	BEAM Ltd,	2007-05-23
 *******************************************************************************
 */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h> 
#include <sys/socket.h>
#include <sys/mman.h>
#include <sys/vfs.h>
#include <sys/param.h>
#include <sys/time.h>
#include <netdb.h>
#include <Control.h>
#include <BHtml.h>
#include <BHtmlPage.h>


Control::Control() : ohttpServer(*this) {
}

Control::~Control(){
}

BError Control::init(){
	BError		err;
	
	// Open and read configuration
	if(oconfig.open("tmsWebDebug.conf"))
		oconfig.open("/etc/tmsWeb.conf");

	oconfig.read();
	
	if(err = ohttpServer.init()){
		return err;
	}
	if(err = ohttpServer.start()){
		return err;
	}

	return err;
}

void Control::run(){
	while(1)
		pause();
}