示例#1
0
        public async ReusableTask <int> ReceiveAsync(SocketMemory buffer)
        {
            if (SlowConnection)
            {
                buffer = buffer.Slice(0, Math.Min(88, buffer.Length));
            }

            var result = await ReadStream.ReadAsync(buffer.Memory);

            Receives.Add(result);
            return(ManualBytesReceived ?? result);
        }
示例#2
0
        public async ReusableTask <int> ReceiveAsync(ByteBuffer buffer, int offset, int count)
        {
            if (SlowConnection)
            {
                count = Math.Min(88, count);
            }

            var result = await ReadStream.ReadAsync(buffer.Data, offset, count, CancellationToken.None);

            Receives.Add(result);
            return(ManualBytesReceived ?? result);
        }
示例#3
0
 public void ReceiveMessage(string messageName)
 {
     Receives.Add(messageName);
 }