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

◆ TryReadFromBuffer()

bool int bytesRead System.Net.Http.Http2Connection.Http2Stream.TryReadFromBuffer ( Span< byte > buffer,
bool partOfSyncRead = false )
inlineprivate

Definition at line 1170 of file Http2Connection.cs.

1171 {
1173 {
1175 if (!_responseBuffer.IsEmpty)
1176 {
1178 int num = Math.Min(buffer.Length, activeMemory.Length);
1179 activeMemory.Slice(0, num).CopyTo(buffer);
1180 _responseBuffer.Discard(num);
1181 return (wait: false, bytesRead: num);
1182 }
1183 if (_responseProtocolState == ResponseProtocolState.Complete)
1184 {
1185 return (wait: false, bytesRead: 0);
1186 }
1187 _hasWaiter = true;
1189 _waitSource.RunContinuationsAsynchronously = !partOfSyncRead;
1190 return (wait: true, bytesRead: 0);
1191 }
1192 }
void CopyTo(KeyValuePair< TKey, TValue >[] array, int index)
System.Net.MultiArrayBuffer _responseBuffer
ManualResetValueTaskSourceCore< bool > _waitSource

References System.Net.Http.Http2Connection.Http2Stream._hasWaiter, System.Net.Http.Http2Connection.Http2Stream._responseBuffer, System.Net.Http.Http2Connection.Http2Stream._responseProtocolState, System.Net.Http.Http2Connection.Http2Stream._waitSource, System.buffer, System.Net.Http.Http2Connection.Http2Stream.CheckResponseBodyState(), System.Collections.Generic.Dictionary< TKey, TValue >.CopyTo(), System.Math.Min(), System.Threading.Tasks.Sources.ManualResetValueTaskSourceCore< TResult >.Reset(), System.Net.Http.Http2Connection.Http2Stream.SyncObject, and System.Net.Http.Http2Connection.Http2Stream.wait.

Referenced by System.Net.Http.Http2Connection.Http2Stream.CopyTo(), System.Net.Http.Http2Connection.Http2Stream.CopyToAsync(), System.Net.Http.Http2Connection.Http2Stream.ReadData(), and System.Net.Http.Http2Connection.Http2Stream.ReadDataAsync().