Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
#include "stdafx.h"
|
||||
#include "IOWorker.h"
|
||||
#include "Overlapped.h"
|
||||
|
||||
#include "../IOCP/CompletionHandler.h"
|
||||
#include "../Session/Session.h"
|
||||
#include "../Listener/Listener.h"
|
||||
|
||||
#include <Log/ServerLog.h>
|
||||
|
||||
CIOWorker::CIOWorker(CCompletionHandler& SocketHandler)
|
||||
: m_SocketHandler(SocketHandler)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CIOWorker::~CIOWorker()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
unsigned int CIOWorker::Run()
|
||||
{
|
||||
COverlapped* lpOverlapped = 0;
|
||||
|
||||
while(true)
|
||||
{
|
||||
unsigned long dwProcessedBytes = 0;
|
||||
ULONG_PTR lpSessionKey = 0;
|
||||
OVERLAPPED* lpOverlappedStruct = 0;
|
||||
|
||||
BOOL bResult = m_SocketHandler.GetHanderStatus(&dwProcessedBytes,
|
||||
&lpSessionKey, &lpOverlappedStruct);
|
||||
|
||||
if(0 == lpSessionKey)
|
||||
{
|
||||
DETLOG4(g_SessionLog, "SP:0x%p/lpOverlapped:0x%p/bResult:%s/Thread 0x%p Completed",
|
||||
lpSessionKey, lpOverlappedStruct, bResult ? "T" : "F", GetCurrentThreadId());
|
||||
break;
|
||||
}
|
||||
|
||||
if(!bResult && 0 == lpOverlappedStruct)
|
||||
{
|
||||
// <20><> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, Ȥ<><C8A4> Ÿ<>Ӿƿ<D3BE>.
|
||||
DETLOG4(g_SessionLog, "SP:0x%p/lpOverlapped:0x%p/bResult:%s/GetQueuedCompletionStatus error : %u",
|
||||
lpSessionKey, lpOverlappedStruct, bResult ? "T" : "F", WSAGetLastError());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Recv, Send, Accept<70><74> <20><>.
|
||||
lpOverlapped = static_cast<COverlapped*>(lpOverlappedStruct);
|
||||
lpOverlapped->Dispatch(bResult, lpSessionKey, dwProcessedBytes);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
BOOL CIOWorker::End()
|
||||
{
|
||||
m_SocketHandler.PostToHandler(0, 0, 0);
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user