初步修复
This commit is contained in:
parent
8fc4357cc6
commit
e4714f3f0e
46705 changed files with 12004901 additions and 0 deletions
55
Server/DNLogServer/DNThreadManager.cpp
Normal file
55
Server/DNLogServer/DNThreadManager.cpp
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
#include "StdAfx.h"
|
||||
#include "DNIocpManager.h"
|
||||
#include "DNThreadManager.h"
|
||||
#include "DNConnection.h"
|
||||
#include "Log.h"
|
||||
#include "DNProtocol.h"
|
||||
#include "DNserviceConnection.h"
|
||||
|
||||
CDNThreadManager g_ThreadManager;
|
||||
|
||||
CDNThreadManager::CDNThreadManager(void): CThreadManager()
|
||||
{
|
||||
}
|
||||
|
||||
CDNThreadManager::~CDNThreadManager(void)
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(PRE_DEL_ONNULL)
|
||||
void CDNThreadManager::OnCalled(CSocketContext *pSocketContext, char *pBuffer, TThreadData* tThreadData)
|
||||
#else
|
||||
void CDNThreadManager::OnCalled(CSocketContext *pSocketContext, char *pBuffer, int nThreadID)
|
||||
#endif
|
||||
{
|
||||
#if defined(PRE_DEL_ONNULL)
|
||||
int nThreadID = tThreadData->nThreadID;
|
||||
#endif
|
||||
switch(pSocketContext->m_dwKeyParam)
|
||||
{
|
||||
case CONNECTIONKEY_DEFAULT:
|
||||
{
|
||||
#if defined( PRE_FIX_SOCKETCONTEXT_DANGLINGPTR )
|
||||
CScopeInterlocked Scope( &pSocketContext->m_lActiveCount );
|
||||
if( Scope.bIsDelete() )
|
||||
break;
|
||||
#endif // #if defined( PRE_FIX_SOCKETCONTEXT_DANGLINGPTR )
|
||||
|
||||
CDNConnection *pCon = (CDNConnection*)pSocketContext->GetParam();
|
||||
if (!pCon) return;
|
||||
|
||||
pCon->FlushDBData( nThreadID );
|
||||
}
|
||||
break;
|
||||
|
||||
case CONNECTIONKEY_SERVICEMANAGER:
|
||||
{
|
||||
CDNServiceConnection *pCon = (CDNServiceConnection*)pSocketContext->GetParam();
|
||||
if (!pCon) return;
|
||||
|
||||
pCon->FlushRecvData(0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
g_pIocpManager->DetachSocket(pSocketContext, L"OnCalled");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue