00001 // Pipe.cpp: implementation of the Pipe class. 00004 00005 00006 #include "stdafx.h" 00007 #include "Pipe.h" 00008 00010 // Construction/Destruction 00012 00017 Pipe::Pipe(const TString& name, const bool isOut) 00018 : pipeName( TEXT("\\\\.\\pipe\\") + name ), isOutbound( isOut ) 00019 { 00020 serverStayConnected = CreateEvent(NULL, true, false, TEXT("SCEVENT") + name); 00021 clientStayConnected = CreateEvent(NULL, true, false, TEXT("CCEVENT") + name); 00022 00023 assert( serverStayConnected != NULL ); 00024 assert( clientStayConnected != NULL ); 00025 } 00026 00030 Pipe::~Pipe() 00031 { 00032 CloseHandle(serverStayConnected); 00033 CloseHandle(clientStayConnected); 00034 }