采用管道进行通讯的例子

作者:肖波
    用Remoting做进程间通讯,效率较低,于是做了一个采用管道技术进行进程间通讯的例子,在1.8G 双核计算机上每秒钟可以发送180M数据。下面给出源码
  
    Server端的管道类

采用管道进行通讯的例子using System;
采用管道进行通讯的例子
using System.Collections.Generic;
采用管道进行通讯的例子
using System.Text;
采用管道进行通讯的例子
using System.Threading;
采用管道进行通讯的例子
using Pipe.Win32;
采用管道进行通讯的例子
采用管道进行通讯的例子
namespace Pipe.Server

Client 端的管道类

采用管道进行通讯的例子using System;
采用管道进行通讯的例子
using System.Collections.Generic;
采用管道进行通讯的例子
using System.Text;
采用管道进行通讯的例子
using System.Diagnostics;
采用管道进行通讯的例子
using Pipe.Win32;
采用管道进行通讯的例子
采用管道进行通讯的例子
namespace Pipe.Client

NTKernel.cs
这个程序文件Client 和 Server 都要,封装了相应的API函数

采用管道进行通讯的例子using System;
采用管道进行通讯的例子
using System.Collections.Generic;
采用管道进行通讯的例子
using System.Text;
采用管道进行通讯的例子
using System.Runtime.InteropServices;
采用管道进行通讯的例子
采用管道进行通讯的例子
采用管道进行通讯的例子
namespace Pipe.Win32

客户端调用

采用管道进行通讯的例子            byte[] buf = new byte[10240];
采用管道进行通讯的例子            Pipe.Client.PipeClient client 
= new Pipe.Client.PipeClient("test"102400);
采用管道进行通讯的例子
采用管道进行通讯的例子            
for (int i = 0; i < 10000; i++)
            }

服务器调用
采用管道进行通讯的例子        static bool begin = true;
采用管道进行通讯的例子        
static System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
采用管道进行通讯的例子        
static int count = 0;
采用管道进行通讯的例子        
static object lockObj = new object();
采用管道进行通讯的例子
采用管道进行通讯的例子        
static void ReceiveMessage(System.IO.MemoryStream m)
        }

源码下载位置

相关文章: