//////////////////////////////////////////////////////////////////////////////////////////////////////////////// internal static async Task <FramingStream> CreateAsync( WriteBuffer writeBuffer, CancellationToken cancellationToken) { await writeBuffer.ReserveAsync(1, cancellationToken); return(new FramingStream(writeBuffer)); }
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); }
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); }
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); }
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 static async Task<FramingStream> CreateAsync( WriteBuffer writeBuffer, CancellationToken cancellationToken) { await writeBuffer.ReserveAsync(1, cancellationToken); return new FramingStream(writeBuffer); }