#include "db_mysql.h"
class CProperty
{
public:
CMysql m_Mysql;
}
void CProperty::Init()
{
net::AddressStr strAddr = Pogo::NarrowToWide(g_pGateConfig->szListenAddr);
int nMaxcon = g_pGateConfig->nMaxCon;
bool bFlag = m_Server.Init(strAddr,nMaxcon);//
if(!bFlag)
{
return ;
}
/*if(!m_wdList.Start(addr,nMaxcon))
{
return;
}*/
if(m_Mysql.Init(g_pGateConfig->szDBServerAddr,
g_pGateConfig->szDBUser,
g_pGateConfig->szDBPassWord,
g_pGateConfig->szDBName))
{
m_Mysql.querys("set names utf8");
}
else
return ;
Logger::Instance()->Init();
m_bValid = true;
return;
//LogDB
/* if (m_MysqlLog.Init(g_pGateConfig->szLogDBServerAddr,
g_pGateConfig->szLogDBUser,
g_pGateConfig->szLogDBPassWord,
g_pGateConfig->szLogDBName))
{
m_MysqlLog.querys("set names utf8");
}
else
return ;
Logger::Instance()->Msg("Log Thread Start");
pthread_create((pthread_t*) & m_nUpdateDBThreadHandle, NULL, &UpdateDBThread, this);
//pthread_create((pthread_t*) & m_nLogDBThreadHandle, NULL, &LogDBThread, this);
return ;*/
}
void CProperty::Shutdown()
{
// m_wdList.Shutdown();
// void *ec;
// pthread_join(m_nUpdateDBThreadHandle, &ec);
// void* el;
// pthread_join(m_nLogDBThreadHandle, &el);
m_Mysql.disconnect();
//m_MysqlLog.disconnect();
}