CSharpRTMP.Core.Protocols.Rtmfp.FlowWriter.Flush C# (CSharp) Method

Flush() public method

public Flush ( H2NBinaryWriter writer, ulong stage, byte flags, bool header, N2HBinaryReader reader, ushort size ) : void
writer H2NBinaryWriter
stage ulong
flags byte
header bool
reader N2HBinaryReader
size ushort
return void
        public void Flush(H2NBinaryWriter writer, ulong stage, byte flags, bool header, N2HBinaryReader reader, ushort size)
        {
            Debug.WriteLine("sent:{0} stage {1}",Id, stage);
            if (_stageAck == 0 && header)
            {
                flags |= MESSAGE_HEADER;
            }
            if (size == 0) flags |= MESSAGE_ABANDONMENT;
            if (Closed && _messages.Count == 1) flags |= MESSAGE_END;
            writer.Write(flags);
            if (header)
            {
                writer.Write7BitLongValue(Id);
                writer.Write7BitLongValue(stage);
                writer.Write7BitLongValue(stage - _stageAck);
                if (_stageAck == 0)
                {
                    writer.WriteString8(Signature);
                    if (FlowId > 0)
                    {
                        writer.Write((byte)(1 + H2NBinaryWriter.Get7BitValueSize(FlowId)));
                        writer.Write((byte)0x0a);
                        writer.Write7BitLongValue(FlowId);
                    }
                    writer.Write((byte)0);
                }
            }
            if (size > 0)
            {
                reader.BaseStream.CopyPartTo(writer.BaseStream,size);
            }
        }
        public void Acknowledgment(N2HBinaryReader reader)

Same methods

FlowWriter::Flush ( bool full = false ) : void

Usage Example

Beispiel #1
0
 public void Flush()
 {
     if (_audioWriter != null)
     {
         _audioWriter.Flush();
     }
     if (_videoWriter != null)
     {
         _videoWriter.Flush();
     }
     _writer.Flush(true);
 }
All Usage Examples Of CSharpRTMP.Core.Protocols.Rtmfp.FlowWriter::Flush