internal async Task Handle_ContentHeader(ReadOnlySequence <byte> payload) { ulong Read() { var reader = new CustomBufferReader(payload); var classId = reader.ReadUInt16(); var weight = reader.ReadUInt16(); var bodySize = reader.ReadUInt64(); pendingDelivery.Properties = reader.ReadBasicProperties(); return(bodySize); } var size = Read(); if (size == 0) { pendingDelivery.Body = new byte[0]; await consumers[pendingDelivery.ConsumerTag](pendingDelivery); pendingDelivery = null; } }
internal Task Handle_Deliver(ReadOnlySequence <byte> arguments) { var reader = new CustomBufferReader(arguments); pendingDelivery = new DeliverState { ConsumerTag = reader.ReadShortString(), DeliveryTag = reader.ReadUInt64(), Redelivered = Convert.ToBoolean(reader.ReadByte()), Exchange = reader.ReadShortString(), RoutingKey = reader.ReadShortString() }; return(Task.CompletedTask); }