////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        internal static async Task <FramingStream> CreateAsync(
            WriteBuffer writeBuffer, CancellationToken cancellationToken)
        {
            await writeBuffer.ReserveAsync(1, cancellationToken);

            return(new FramingStream(writeBuffer));
        }
Example #2
0
 internal async Task WriteToAsync(WriteBuffer writerBuffer, CancellationToken cancellationToken)
 {
     await writerBuffer.ReserveAsync(2, cancellationToken);
     writerBuffer[writerBuffer.Count++] = this.Slot;
     writerBuffer[writerBuffer.Count++] = this.messageType;
     await this.Command.WriteToAsync(writerBuffer, cancellationToken);
 }
Example #3
0
        internal async Task WriteToAsync(WriteBuffer writerBuffer, CancellationToken cancellationToken)
        {
            await writerBuffer.ReserveAsync(2, cancellationToken);

            writerBuffer[writerBuffer.Count++] = this.Slot;
            writerBuffer[writerBuffer.Count++] = this.messageType;
            await this.Command.WriteToAsync(writerBuffer, cancellationToken);
        }
Example #4
0
        internal async Task WriteToAsync(WriteBuffer writeBuffer, CancellationToken cancellationToken)
        {
            await writeBuffer.ReserveAsync(2, cancellationToken);

            writeBuffer[writeBuffer.Count++] = (byte)this.commandType;
            writeBuffer[writeBuffer.Count++] = DefaultVersion;
            await this.WriteToCoreAsync(writeBuffer, cancellationToken);
        }
Example #5
0
        internal sealed override async Task WriteToCoreAsync(
            WriteBuffer writeBuffer, CancellationToken cancellationToken)
        {
            await base.WriteToCoreAsync(writeBuffer, cancellationToken);

            await writeBuffer.ReserveAsync(1, cancellationToken);

            writeBuffer[writeBuffer.Count++] = (byte)(this.IsActive ? 1 : 0);
        }
Example #6
0
 internal sealed override async Task WriteToCoreAsync(
     WriteBuffer writeBuffer, CancellationToken cancellationToken)
 {
     await base.WriteToCoreAsync(writeBuffer, cancellationToken);
     await writeBuffer.ReserveAsync(3, cancellationToken);
     writeBuffer[writeBuffer.Count++] = (byte)this.PacketFlags;
     writeBuffer[writeBuffer.Count++] = this.dtd;
     writeBuffer[writeBuffer.Count++] = (byte)this.applicationBytes.Length;
     await writeBuffer.WriteAsync(
         this.applicationBytes, 0, this.applicationBytes.Length, cancellationToken);
 }
        internal sealed override async Task WriteToCoreAsync(
            WriteBuffer writeBuffer, CancellationToken cancellationToken)
        {
            await base.WriteToCoreAsync(writeBuffer, cancellationToken);

            await writeBuffer.ReserveAsync(3, cancellationToken);

            writeBuffer[writeBuffer.Count++] = (byte)this.PacketFlags;
            writeBuffer[writeBuffer.Count++] = this.dtd;
            writeBuffer[writeBuffer.Count++] = (byte)this.applicationBytes.Length;
            await writeBuffer.WriteAsync(
                this.applicationBytes, 0, this.applicationBytes.Length, cancellationToken);
        }
Example #8
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        internal static async Task<FramingStream> CreateAsync(
            WriteBuffer writeBuffer, CancellationToken cancellationToken)
        {
            await writeBuffer.ReserveAsync(1, cancellationToken);
            return new FramingStream(writeBuffer);
        }