Base.AChannel.Recv C# (CSharp) Метод

Recv() публичный абстрактный Метод

接收消息
public abstract Recv ( ) : Task
Результат Task
		public abstract Task<byte[]> Recv();

Usage Example

Пример #1
0
        private void UpdateChannel(AChannel channel)
        {
            if (channel.Id == 0)
            {
                return;
            }

            while (true)
            {
                byte[] messageBytes = channel.Recv();
                if (messageBytes == null)
                {
                    return;
                }

                if (messageBytes.Length < 6)
                {
                    continue;
                }

                Opcode opcode = (Opcode)BitConverter.ToUInt16(messageBytes, 0);
                try
                {
                    this.Run(opcode, messageBytes);
                }
                catch (Exception e)
                {
                    Log.Error(e.ToString());
                }
            }
        }