public static void WriteSettings(this PipeWriter writer, Http2PeerSettings clientSettings) { var frame = new Http2Frame(); frame.PrepareSettings(Http2SettingsFrameFlags.NONE); var settings = clientSettings.GetNonProtocolDefaults(); var payload = new byte[settings.Count * Http2FrameReader.SettingSize]; frame.PayloadLength = payload.Length; Http2FrameWriter.WriteSettings(settings, payload); Http2FrameWriter.WriteHeader(frame, writer); writer.Write(payload); }
public async Task SendSettingsAsync() { var writableBuffer = _pair.Application.Output; var frame = new Http2Frame(); frame.PrepareSettings(Http2SettingsFrameFlags.NONE); var settings = _clientSettings.GetNonProtocolDefaults(); var payload = new byte[settings.Count * Http2FrameReader.SettingSize]; frame.PayloadLength = payload.Length; Http2FrameWriter.WriteSettings(settings, payload); Http2FrameWriter.WriteHeader(frame, writableBuffer); await SendAsync(payload); }