32 lines
616 B
C++
32 lines
616 B
C++
#include "StdAfx.h"
|
|
#include "DNConnectionManager.h"
|
|
#include "DNConnection.h"
|
|
#include "Util.h"
|
|
|
|
CDNConnectionManager* g_pConnectionManager = NULL;
|
|
|
|
CDNConnectionManager::CDNConnectionManager(void): CConnectionManager()
|
|
{
|
|
|
|
}
|
|
|
|
CDNConnectionManager::~CDNConnectionManager(void)
|
|
{
|
|
|
|
}
|
|
|
|
CConnection* CDNConnectionManager::AddConnection(const char *pIp, const USHORT nPort)
|
|
{
|
|
CDNConnection *pCon = new CDNConnection;
|
|
if (!pCon) return NULL;
|
|
|
|
// ±×³É ¸¶½ºÅÍ Ä¿³Ø¼Ç ID¹ßÇà..
|
|
pCon->SetSessionID(g_IDGenerator.GetMasterConnectionID());
|
|
pCon->SetIp(pIp);
|
|
pCon->SetPort(nPort);
|
|
|
|
PushConnection(pCon);
|
|
|
|
return pCon;
|
|
}
|
|
|