当前位置: 首页>>代码示例>>C#>>正文


C# UruStream.BufferWriter方法代码示例

本文整理汇总了C#中MUd.UruStream.BufferWriter方法的典型用法代码示例。如果您正苦于以下问题:C# UruStream.BufferWriter方法的具体用法?C# UruStream.BufferWriter怎么用?C# UruStream.BufferWriter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MUd.UruStream的用法示例。


在下文中一共展示了UruStream.BufferWriter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Connect

        public override bool Connect()
        {
            if (!base.Connect()) return false;

            //Send the FileConnectHeader
            UruStream s = new UruStream(new NetworkStream(fSocket, false));
            s.BufferWriter();
            fHeader.Write(s);
            s.WriteUInt(12); //Size
            s.WriteUInt(0);
            s.WriteUInt(0);
            s.FlushWriter();
            s.Close();

            fSocket.BeginReceive(new byte[4], 0, 4, SocketFlags.Peek, new AsyncCallback(IReceive), null);
            return true;
        }
开发者ID:Hoikas,项目名称:mudpit,代码行数:17,代码来源:FileClient.cs

示例2: Connect

        public override bool Connect()
        {
            if (!base.Connect()) return false;

            //Send the GateConnectHeader
            UruStream s = new UruStream(new NetworkStream(fSocket, false));
            s.BufferWriter();
            fHeader.Write(s);
            s.WriteInt(20);
            s.WriteBytes(Guid.Empty.ToByteArray());
            s.FlushWriter();
            s.Close();

            //Init encryption
            if (!base.NetCliConnect(4))
                return false;

            fSocket.BeginReceive(new byte[2], 0, 2, SocketFlags.Peek, new AsyncCallback(IReceive), null);
            return true;
        }
开发者ID:Hoikas,项目名称:mudpit,代码行数:20,代码来源:GateClient.cs

示例3: NetCliConnect

        protected virtual bool NetCliConnect(int g)
        {
            UruStream s = new UruStream(new NetworkStream(fSocket, false));

            //NetCliConnect
            ISetupKeys(g);
            s.BufferWriter();
            s.WriteByte((byte)NetCliConnectMsg.kNetCliConnect);
            s.WriteByte(66);
            s.WriteBytes(fDhData);
            s.FlushWriter();

            //Recv NetCliEncrypt
            if (s.ReadByte() != (byte)NetCliConnectMsg.kNetCliEncrypt) { fSocket.Close(); return false; }
            byte[] seed = s.ReadBytes((int)(s.ReadByte() - 2));
            ISetupEncryption(seed);

            s.Close();
            return true;
        }
开发者ID:Hoikas,项目名称:mudpit,代码行数:20,代码来源:Cli2Srv.cs

示例4: Connect

        public override bool Connect()
        {
            if (!base.Connect()) return false;

            //Send the AuthConnectHeader
            UruStream s = new UruStream(new NetworkStream(fSocket, false));
            s.BufferWriter();
            fHeader.Write(s);
            s.WriteInt(20);
            s.WriteBytes(Guid.Empty.ToByteArray());
            s.FlushWriter();
            s.Close();

            //Init encryption
            if(!base.NetCliConnect(41))
                return false;

            //Register the client...
            //Don't require the user to do this.
            Auth_RegisterRequest req = new Auth_RegisterRequest();
            req.fBuildID = fHeader.fBuildID;

            fStream.BufferWriter();
            fStream.WriteUShort((ushort)AuthCli2Srv.ClientRegisterRequest);
            req.Write(fStream);
            fStream.FlushWriter();

            fSocket.BeginReceive(new byte[2], 0, 2, SocketFlags.Peek, new AsyncCallback(IReceive), null);
            fChgHack.Reset(); fChgHack.WaitOne();

            return true;
        }
开发者ID:Hoikas,项目名称:mudpit,代码行数:32,代码来源:AuthClient.cs


注:本文中的MUd.UruStream.BufferWriter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。