Example #1
0
File: Data.cs Project: lulzzz/Port
        protected override async ValueTask WriteFrameAsync(
            IFrameWriter frameWriter,
            CancellationToken cancellationToken = default)
        {
            var data = StreamId
                       .SetBit(31, false);
            await frameWriter.WriteUInt32Async(data, cancellationToken)
            .ConfigureAwait(false);

            await frameWriter.WriteByteAsync((byte)Flags, cancellationToken)
            .ConfigureAwait(false);

            await frameWriter.WriteUInt24Async(
                UInt24.From((uint)Payload.Length), cancellationToken)
            .ConfigureAwait(false);

            await frameWriter.WriteBytesAsync(Payload, cancellationToken)
            .ConfigureAwait(false);
        }