public Http2AltsvcFrame(Http2FrameHeader header, byte[] origin, byte[] altSvcFieldValue) { this.Header = header; this.OriginLen = (ushort)origin.Length; this.Origin = origin; this.AltSvcFieldValue = altSvcFieldValue; }
public Http2PriorityFrame(Http2FrameHeader header, bool e, int streamDependencyID, byte weight) { this.Header = header; this.E = e; this.StreamDependencyID = streamDependencyID; this.Weight = weight; }
public Http2GoawayFrame(Http2FrameHeader header, int lastStreamID, Http2ErrorCode errorCode, byte[] additionalDebugData) { this.Header = header; this.R = false; this.LastStreamID = lastStreamID; this.ErrorCode = errorCode; this.AdditionalDebugData = additionalDebugData; }
public Http2RstStreamFrame(Http2FrameHeader header, byte[] data) { if (data.Length != header.Length) { throw new ArgumentException("Invalid Length."); } this.Header = header; this.ErrorCode = (Http2ErrorCode)data.ToUInt32(0); }
public Http2PingFrame(Http2FrameHeader header, byte[] data) { if (data.Length != header.Length) { throw new ArgumentException("Invalid Length."); } this.Header = header; this.OpaqueData = data; }
public Http2ContinuationFrame(Http2FrameHeader header, byte[] data) { if (data.Length != header.Length) { throw new ArgumentException("Invalid Length."); } this.Header = header; this.HeaderBlockFragment = data; }
public Http2WindowUpdateFrame(Http2FrameHeader header, byte[] data) { if (data.Length != header.Length) { throw new ArgumentException("Invalid Length."); } this.Header = header; this.R = data[0].HasFlag(0b10000000); this.WindowSizeIncrement = data.ToUInt31(0); }
public Http2AltsvcFrame(Http2FrameHeader header, byte[] data) { if (data.Length != header.Length) { throw new ArgumentException("Invalid Length."); } this.Header = header; this.OriginLen = data.ToUInt16(0); this.Origin = data.Skip(2).Take(this.OriginLen).ToArray(); this.AltSvcFieldValue = data.Skip(2 + this.OriginLen).ToArray(); }
public Http2PriorityFrame(Http2FrameHeader header, byte[] data) { if (data.Length != header.Length) { throw new ArgumentException("Invalid Length."); } this.Header = header; this.E = data[0].HasFlag(0b10000000); this.StreamDependencyID = data.ToUInt31(0); this.Weight = data[4]; }
public static Http2RstStreamFrame Create( int streamID, Http2ErrorCode errorCode) { var header = new Http2FrameHeader( 4, Http2FrameType.RstStream, 0, streamID); return(new Http2RstStreamFrame(header, errorCode)); }
public Http2GoawayFrame(Http2FrameHeader header, byte[] data) { if (data.Length != header.Length) { throw new ArgumentException("Invalid Length."); } this.Header = header; this.R = data[0].HasFlag(0b10000000); this.LastStreamID = data.ToUInt31(0); this.ErrorCode = (Http2ErrorCode)data.ToUInt32(4); this.AdditionalDebugData = data.Skip(8).ToArray(); }
public static Http2GoawayFrame Create( int streamID, int lastStreamID, Http2ErrorCode errorCode, byte[] additionalDebugData) { var header = new Http2FrameHeader( 4 + 4 + additionalDebugData.Length, Http2FrameType.Goaway, 0, streamID); return(new Http2GoawayFrame(header, lastStreamID, errorCode, additionalDebugData)); }
public static Http2ContinuationFrame Create( int streamID, bool isEndHeaders, byte[] headerBlockFragment) { var flags = isEndHeaders ? (byte)Flag.EndHeaders : (byte)0; var header = new Http2FrameHeader( headerBlockFragment.Length, Http2FrameType.Continuation, flags, streamID); return(new Http2ContinuationFrame(header, headerBlockFragment)); }
public Http2OriginFrame(Http2FrameHeader header, byte[] data) { if (data.Length != header.Length) { throw new ArgumentException("Invalid Length."); } this.Header = header; var entries = new List <OriginEntry>(); var index = 0; while (index < data.Length) { var entry = new OriginEntry(); entry.OriginLen = data.ToUInt16(index); index += 2; entry.AsciiOrigin = data.Skip(index).Take(entry.OriginLen).ToArray(); index += entry.OriginLen; entries.Add(entry); } this.OriginEntries = entries; }
public Http2OriginFrame(Http2FrameHeader header, IReadOnlyList <OriginEntry> originEntries) { this.Header = header; this.OriginEntries = originEntries; }
public Http2RstStreamFrame(Http2FrameHeader header, Http2ErrorCode errorCode) { this.Header = header; this.ErrorCode = errorCode; }
public Http2UnknownFrame(Http2FrameHeader header, byte[] data) { this.Header = header; this.Payload = data; }