#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>

#include "./include/db_adaptor.h"

extern int dba_conn_thread(void *param);

int dba_main(int argc, char **argv)
{
	int i=0;
	pthread_t th[MAX_DB_CONN];
	u8   	  param[2];
	
	dba_read_cfg();
	logWriter_init();
	
	i = 0;
	param[0] = i;
	if(1)
	{
		pthread_create(&th[i],NULL,dba_conn_thread, (void *)param);
		//pthread_join(th[i],NULL);
	}
	else
		dba_conn_thread(NULL);

	if(0)
	{
		while(1)
		{
			logWriter_rt();
			sleep(5);
		}
	}
	return 1;
}

void dba_init()
{
	dba_read_cfg();
	logWriter_init();
}

