123456789101112131415161718192021222324252627 |
- #ifndef NAME_PIPE_SERVER_H
- #define NAME_PIPE_SERVER_H
- #include<windows.h>
- #include<iostream>
- class NamePipeServer
- {
- public:
- NamePipeServer()
- {
- pStr = _T("data from server");
- pPipeName = _T("\\\\.\\pipe\\testPipe");
- }
- //创建命名管道
- void CreateNamedPipeInServer();
- //从命名管道中读取数据
- void NamedPipeReadInServer();
- //往命名管道中写入数据
- void NamedPipeWriteInServer();
- private:
- HANDLE hNamedPipe;
- const char *pStr;
- const char *pPipeName;
- };
- #endif
|