lineCode / WinFastIPC

管道实现的进程间通信库,多线程支持

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

进程间通信(IPC,InterProcess Communication)

例子一:WinPipeWapper

移除第三方头文件依赖,使用std::string作为消息容器。

封装为一个类,使用简单,适用于小项目。

void th_pipeWrite()
{
	Pipe pipe;
	pipe.CreatePipe("test_pipe");
	int nCount = 1;
	char szNum[10] = { 0 };
	do 
	{
		itoa(nCount, szNum, 10);
		nCount++;
		std::string strMsg = "WinPip中文123_测试";
		strMsg.append(szNum);
		pipe.PipeSendMessage(strMsg);
		// 写的时间间要大于读的时间间隔
		Sleep(500);
	} while (!g_bExit);
}

demo


例子二:FastIPC

代码从DarkoreXORhooklib项目中提取的。

说明

FastIpc使用管道来实现通信,支持多线程。

测试demo:

snatshot

About

管道实现的进程间通信库,多线程支持


Languages

Language:C++ 74.9%Language:C 24.4%Language:Batchfile 0.7%