示例#1
0
文件: Pipe.cs 项目: somdoron/NetMQ4
        public static void CreatePair(Socket connectSocket, Socket bindSocket,
            int connetHighWatermark, int bindHighwatermark, out Pipe connectPipe, out Pipe bindPipe)
        {
            //   Creates two pipe objects. These objects are connected by two ypipes,
            //   each to pass messages in one direction.

            YPipe<Frame> upipe1 = new YPipe<Frame>();
            YPipe<Frame> upipe2 = new YPipe<Frame>();

            connectPipe = new Pipe(connectSocket, upipe1, upipe2, connetHighWatermark, bindHighwatermark);
            bindPipe = new Pipe(bindSocket, upipe2, upipe1, bindHighwatermark, connetHighWatermark);

            connectPipe.SetPeer(bindPipe);
            bindPipe.SetPeer(connectPipe);
        }