3 #ifndef _CPL_NAMED_PIPES_H_ 4 #define _CPL_NAMED_PIPES_H_ 11 #include "base classses.h" 12 #include "cpl queue.h" 16 extern __int64 g_llMaxQueueBytes;
17 extern void InitializeQueueLimit();
38 OVERLAPPED oWriteOverlap;
44 SPipeResource(HANDLE hWriteEventE) : cWriteQueue(hWriteEventE)
48 hWriteEvent= hWriteEventE;
49 oWriteOverlap.hEvent= hWriteEvent;
55 DisconnectNamedPipe(hPipe);
58 CloseHandle(hWriteEvent);
67 SData* pData= cWriteQueue.
Front(
true, bNotEmpty);
70 llCount += pData->dwSize;
71 pData->pDevice->
Result(pData->pHead,
false);
80 memset(&oOverlap, 0,
sizeof(OVERLAPPED));
81 memset(&oWriteOverlap, 0,
sizeof(OVERLAPPED));
83 DisconnectNamedPipe(hPipe);
85 ResetEvent(hWriteEvent);
86 fWritePending= fPending= FALSE;
88 oWriteOverlap.hEvent= hWriteEvent;
89 oOverlap.hEvent= hEvent;
114 int Init(
const TCHAR szPipe[],
int nPipes, DWORD dwBuffSizeIn, DWORD dwBuffSizeOut,
CDevice *cDevice,
116 int SendData(
const SData *pData, __int64 llId);
121 std::tstring m_csPipe;
124 DWORD m_dwBuffSizeIn;
125 DWORD m_dwBuffSizeOut;
129 std::tostringstream m_sStream;
133 std::vector<SPipeResource*> m_aPipes;
134 std::vector<HANDLE> m_ahEvents;
136 CRITICAL_SECTION m_sPipeSafe;
137 CRITICAL_SECTION m_sInitSafe;
virtual void Result(void *pHead, bool bPass)=0
T Front(bool bPop, bool &bValid)