SDC C-Project CF Review 프로그램
LYW
2021-08-10 8ac7359b04409c2a1426f9a179c00b1c966d0146
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once
 
#include "MemPooler.h"
#include "IOCPProcessThreadDef.h"
#include "IOCPDefinition.h"
 
class AFX_EXT_CLASS CMemoryPool : public IIOCPProcessThread
{
public:
    CMemoryPool();
    virtual ~CMemoryPool();
 
    virtual void ProcessingThread() = 0;
 
protected:
 
    SOCKET                            m_ListenSocket;                    // ¸®½¼ ¼ÒÄÏ
    CMemPooler<PerSocketContext> *    m_pPerSocketCtxMemPool;
    CMemPooler<PerIoContext> *        m_pRecvMemPool;
    CMemPooler<PerIoContext> *        m_pSendMemPool;
 
    pPerSocketContext AllocPerSocketContext(SOCKET clientSocket);        // PerSocketContext ¸Þ¸ð¸® ÇÒ´ç
    int GetSocketContextAllocCount();
    void DeallocPerSocketContext(pPerSocketContext pPerSocketCtx);        // PerSocketContext ¸Þ¸ð¸® Á¦°Å
 
private:
    pPerIoContext AllocPerIoContextForSend(void);                    // PerSendIoContext ¸Þ¸ð¸® ÇÒ´ç
    pPerIoContext AllocPerIoContextForRecv(void);                    // PerRecvIoContext ¸Þ¸ð¸® ÇÒ´ç
    void DeallocPerIoContextForRecv(pPerIoContext pPerIoCtx);        // PerRecvIoContext ¸Þ¸ð¸® Á¦°Å
    void DeallocPerIoContextForSend(pPerIoContext pPerIoCtx);        // PerSendIoContext ¸Þ¸ð¸® Á¦°Å
};