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


C# Byte.Redim方法代码示例

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


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

示例1: GameListener

        /// <summary>
        /// Game Connection Packet List Manager.
        /// </summary>
        protected void GameListener(object args)
        {
            if (State == ConnectionState.Connected && StreamGame != null && StreamLocal != null) {
                try {
                    if (StreamGame != null && StreamGame.CanRead && StreamGame.DataAvailable) {
                        //Byte to Store Server Packets.
                        var data = new Byte[8192];

                        //Get Game Server Packets.
                        var length = StreamGame.Read(data, 0, data.Length);

                        if (length > 0) {
                            //Send Packet to Client if Needed.
                            if (StreamLocal.CanWrite) { StreamLocal.Write(data, 0, length); }

                            //Stack the Intercepted Packet.
                            PacketChangedCall.BeginInvoke(data.Redim(length), PacketSource.Server, null, PacketChangedCall);

                            //Initialize the Client Listener, if Needed.
                            if (TMClientListener != null) { return; }
                            TMClientListener = new System.Threading.Timer(ClientListener, null, 0, 100);
                        }
                    }
                }
                catch (IOException) { Disconnect(); }
            }
        }
开发者ID:alexisjojo,项目名称:ktibiax,代码行数:30,代码来源:Proxy.cs

示例2: ClientListener

        /// <summary>
        /// Client Connection Packet List Manager.
        /// </summary>
        protected void ClientListener(object args)
        {
            try {
                if (StreamLocal != null && StreamLocal.CanRead && StreamLocal.DataAvailable) {
                    //Byte to Store Client Packets.
                    var data = new Byte[8192];

                    //Get Client Local Packets.
                    var length = StreamLocal.Read(data, 0, data.Length);

                    if (length > 0) {
                        //Send Packet to Server if Needed.
                        if (StreamGame.CanWrite) { StreamGame.Write(data, 0, length); }

                        //Stack the Intercepted Packet.
                        PacketChangedCall.BeginInvoke(data.Redim(length), PacketSource.Client, null, PacketChangedCall);
                    }
                }
            }
            catch (IOException) { Disconnect(); }
        }
开发者ID:alexisjojo,项目名称:ktibiax,代码行数:24,代码来源:Proxy.cs


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