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); }
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); }
public void ReceiveMessage(string messageName) { Receives.Add(messageName); }