Exemplo n.º 1
0
INT32 CNetClient::StartNetService(char* pszLogPath)
{
	INT32 iRet;

	if(NULL != m_pSockCli)
	{
		return 0;
	}

	iRet = StartNetBase();
	if(iRet < 0)
	{
		StopNetService();
		return -1;
	}

	//m_pSockCli = CreateSocketClient();
	m_pSockCli = CreateNetService();
	if(NULL == m_pSockCli)
	{
		StopNetService();
		return -2;
	}
	m_pSockCli->InitLog(pszLogPath);
	m_pSockCli->SetReConnect(FALSE);
	m_pSockCli->SetOnEventCallBack(this, SocketEventCB);
	iRet = m_pSockCli->InitSimpleNetService();// ³Â´ÏÐÞ¸Ä 20120521
	if(iRet != ERROR_BASE_SUCCESS)
	{
		StopNetService();
		return -4;
	}
	return 0;
}
Exemplo n.º 2
0
CApp::CApp()
	: m_pNetService(nullptr)
	, m_pEventManager(nullptr)
	, m_pTimerManager(nullptr)
{
	m_pNetService = CreateNetService();
}
Exemplo n.º 3
0
CApp::CApp()
	: m_pNetService(nullptr)
	, m_pNetAcceptor(nullptr)
	, m_pTimerManager(nullptr)
	, m_pEventManager(nullptr)
	, m_nRunTimerId(0)
{
	m_pNetService = CreateNetService();
}