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>
61 lines
1.3 KiB
C++
61 lines
1.3 KiB
C++
#ifndef _CIOCPMGR_H_
|
|
#define _CIOCPMGR_H_
|
|
|
|
#include <map>
|
|
#include <list>
|
|
#include "../../Thread/Lock.h"
|
|
|
|
// Àü¹æ ÂüÁ¶
|
|
class CListener;
|
|
class CSession;
|
|
class CSessionPolicy;
|
|
class CCompletionHandler;
|
|
class CThreadMgr;
|
|
class CSessionMgr;
|
|
class CValidateConnection;
|
|
|
|
class CIOCPNet
|
|
{
|
|
public:
|
|
|
|
CIOCPNet();
|
|
~CIOCPNet();
|
|
|
|
bool Initialize();
|
|
bool Destroy();
|
|
|
|
bool AddListener(CSessionPolicy* lpSessionPolicy,
|
|
const char* lpListenAddress, unsigned short usPort,
|
|
unsigned long dwMaxListenPeding = 10,
|
|
CValidateConnection* lpValidateConnection = 0);
|
|
|
|
bool Connect(CSessionPolicy* lpSessionPolicy,
|
|
const char* lpConnectAddress, unsigned short usPort);
|
|
|
|
void Process();
|
|
|
|
unsigned long GetAcceptPendingNum();
|
|
unsigned long GetSessionNum();
|
|
|
|
private:
|
|
|
|
void DestroyListener();
|
|
|
|
typedef std::list<CListener*> ListenerList;
|
|
typedef std::map<CSessionPolicy*, unsigned int> SessionPolicyMap;
|
|
|
|
typedef CCSLock SessionLock;
|
|
|
|
SessionLock m_IOCPLock;
|
|
CACHE_PAD(SessionLockPad, sizeof(SessionLock));
|
|
|
|
CCompletionHandler* m_lpSocketHandler;
|
|
CThreadMgr* m_lpThreadMgr;
|
|
CSessionMgr* m_lpSessionMgr;
|
|
|
|
ListenerList m_ListenerList;
|
|
SessionPolicyMap m_SessionPolicyMap;
|
|
unsigned long m_dwFlags;
|
|
};
|
|
|
|
#endif |