Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SendStreamDataAsync()

async Task System.Net.Http.Http2Connection.SendStreamDataAsync ( int streamId,
ReadOnlyMemory< byte > buffer,
bool finalFlush,
CancellationToken cancellationToken )
inlineprivate

Definition at line 2947 of file Http2Connection.cs.

2948 {
2950 while (remaining.Length > 0)
2951 {
2952 int frameSize = Math.Min(remaining.Length, 16384);
2956 remaining = tuple.Item2;
2957 bool item2 = false;
2958 if (finalFlush && remaining.Length == 0)
2959 {
2960 item2 = true;
2961 }
2963 {
2964 item2 = true;
2965 }
2966 try
2967 {
2969 {
2970 if (System.Net.NetEventSource.Log.IsEnabled())
2971 {
2972 s.thisRef.Trace(s.streamId, $"Started writing. {"Length"}={writeBuffer.Length}", "SendStreamDataAsync");
2973 }
2974 FrameHeader.WriteTo(writeBuffer.Span, s.current.Length, FrameType.Data, FrameFlags.None, s.streamId);
2975 s.current.CopyTo(writeBuffer.Slice(9));
2976 return s.flush;
2978 }
2979 catch
2980 {
2982 throw;
2983 }
2984 }
2985 }
ValueTask< int > RequestCreditAsync(int amount, CancellationToken cancellationToken)
static ReadOnlyMemory< byte > ReadOnlyMemory< byte > rest SplitBuffer(ReadOnlyMemory< byte > buffer, int maxSize)
readonly CreditManager _connectionWindow
Http2Connection(HttpConnectionPool pool, Stream stream)
static readonly System.Net.NetEventSource Log
ConfiguredValueTaskAwaitable ConfigureAwait(bool continueOnCapturedContext)
Definition ValueTask.cs:312

References System.Net.Http.Http2Connection._connectionWindow, System.Net.Http.CreditManager.AdjustCredit(), System.buffer, System.cancellationToken, System.Threading.Tasks.ValueTask< TResult >.ConfigureAwait(), System.Net.Http.CreditManager.IsCreditAvailable, System.item, System.Net.NetEventSource.Log, System.Math.Min(), System.Net.Http.CreditManager.RequestCreditAsync(), System.s, System.Net.Http.Http2Connection.SplitBuffer(), and System.Net.Http.Http2Connection.FrameHeader.WriteTo().

Referenced by System.Net.Http.Http2Connection.Http2Stream.SendDataAsync().