Ejemplo n.º 1
0
        // STREAM流,建立连接通信
        public BaseStream CreateStream(Head create, StreamType st)
        {
            BaseStream stream;

            switch (st)
            {
            case StreamType.Call_RW:
                stream = new CallRWStream();
                break;

            case StreamType.Send_W:
                stream = new SendWStream();
                break;

            case StreamType.Stream_RW:
                stream = new StreamReadWrightStream();
                break;

            case StreamType.Stream_R:
                stream = new StreamReadStream();
                break;

            case StreamType.Stream_W:
                stream = new StreamWrightStream();
                break;

            default:
                stream = new OldPLStream();
                break;
            }
            Streams.Add(stream.StreamId, stream);
            stream.StreamCreate(create, this);

            return(stream);
        }
Ejemplo n.º 2
0
        // 无返回值RPC CALL
        public void Send(Head headpackage)
        {
            SendWStream stream = new SendWStream();

            Streams.Add(stream.StreamId, stream);
            stream.StreamWright(headpackage, this);
        }