Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
System.Net.Http.HttpConnection Class Referencesealed

Classes

class  ChunkedEncodingReadStream
 
class  ChunkedEncodingWriteStream
 
class  ConnectionCloseReadStream
 
class  ContentLengthReadStream
 
class  ContentLengthWriteStream
 
class  HttpContentReadStream
 
class  HttpContentWriteStream
 
class  RawConnectionStream
 

Public Member Functions

 HttpConnection (HttpConnectionPool pool, Socket socket, Stream stream, TransportContext transportContext)
 
override void Dispose ()
 
bool PrepareForReuse (bool async)
 
override bool CheckUsabilityOnScavenge ()
 
override long GetIdleTicks (long nowTicks)
 
async Task< HttpResponseMessageSendAsyncCore (HttpRequestMessage request, bool async, CancellationToken cancellationToken)
 
Task< HttpResponseMessageSendAsync (HttpRequestMessage request, bool async, CancellationToken cancellationToken)
 
async ValueTask DrainResponseAsync (HttpResponseMessage response, CancellationToken cancellationToken)
 
override string ToString ()
 
override void Trace (string message, [CallerMemberName] string memberName=null)
 
string GetResponseHeaderValueWithCaching (HeaderDescriptor descriptor, ReadOnlySpan< byte > value, Encoding valueEncoding)
 
long GetLifetimeTicks (long nowTicks)
 

Protected Member Functions

void TraceConnection (Stream stream)
 

Package Functions

void Acquire ()
 
void Release ()
 
void DetachFromPool ()
 
void LogExceptions (Task task)
 

Static Package Functions

static bool IsDigit (byte c)
 
static int ParseStatusCode (ReadOnlySpan< byte > value)
 
static void IgnoreExceptions (ValueTask< int > task)
 

Properties

TransportContext TransportContext [get]
 
HttpConnectionKind Kind [get]
 
int ReadBufferSize [get]
 
ReadOnlyMemory< byte > RemainingBuffer [get]
 

Private Member Functions

 ~HttpConnection ()
 
void Dispose (bool disposing)
 
ValueTask< int >? ConsumeReadAheadTask ()
 
void ConsumeFromRemainingBuffer (int bytesToConsume)
 
async ValueTask WriteHeadersAsync (HttpHeaders headers, string cookiesFromContainer, bool async)
 
async ValueTask WriteHostHeaderAsync (Uri uri, bool async)
 
Task WriteDecimalInt32Async (int value, bool async)
 
Task WriteHexInt32Async (int value, bool async)
 
bool MapSendException (Exception exception, CancellationToken cancellationToken, out Exception mappedException)
 
HttpContentWriteStream CreateRequestContentStream (HttpRequestMessage request)
 
CancellationTokenRegistration RegisterCancellation (CancellationToken cancellationToken)
 
async ValueTask SendRequestContentAsync (HttpRequestMessage request, HttpContentWriteStream stream, bool async, CancellationToken cancellationToken)
 
async Task SendRequestContentWithExpect100ContinueAsync (HttpRequestMessage request, Task< bool > allowExpect100ToContinueTask, HttpContentWriteStream stream, Timer expect100Timer, bool async, CancellationToken cancellationToken)
 
void WriteToBuffer (ReadOnlySpan< byte > source)
 
void WriteToBuffer (ReadOnlyMemory< byte > source)
 
void Write (ReadOnlySpan< byte > source)
 
async ValueTask WriteAsync (ReadOnlyMemory< byte > source, bool async)
 
void WriteWithoutBuffering (ReadOnlySpan< byte > source)
 
ValueTask WriteWithoutBufferingAsync (ReadOnlyMemory< byte > source, bool async)
 
async ValueTask FlushThenWriteWithoutBufferingAsync (ReadOnlyMemory< byte > source, bool async)
 
Task WriteByteAsync (byte b, bool async)
 
async Task WriteByteSlowAsync (byte b, bool async)
 
Task WriteTwoBytesAsync (byte b1, byte b2, bool async)
 
async Task WriteTwoBytesSlowAsync (byte b1, byte b2, bool async)
 
Task WriteBytesAsync (byte[] bytes, bool async)
 
async Task WriteBytesSlowAsync (byte[] bytes, int length, bool async)
 
Task WriteStringAsync (string s, bool async)
 
Task WriteStringAsync (string s, bool async, Encoding encoding)
 
async Task WriteStringWithEncodingAsyncSlow (string s, bool async, Encoding encoding)
 
Task WriteAsciiStringAsync (string s, bool async)
 
async Task WriteStringAsyncSlow (string s, bool async)
 
void Flush ()
 
ValueTask FlushAsync (bool async)
 
void WriteToStream (ReadOnlySpan< byte > source)
 
ValueTask WriteToStreamAsync (ReadOnlyMemory< byte > source, bool async)
 
bool TryReadNextLine (out ReadOnlySpan< byte > line)
 
async ValueTask< ReadOnlyMemory< byte > > ReadNextResponseHeaderLineAsync (bool async, bool foldedHeadersAllowed=false)
 
void ThrowIfExceededAllowedReadLineBytes ()
 
void Fill ()
 
async ValueTask InitialFillAsync (bool async)
 
async ValueTask FillAsync (bool async)
 
void ReadFromBuffer (Span< byte > buffer)
 
int Read (Span< byte > destination)
 
async ValueTask< int > ReadAsync (Memory< byte > destination)
 
int ReadBuffered (Span< byte > destination)
 
ValueTask< int > ReadBufferedAsync (Memory< byte > destination)
 
async ValueTask< int > ReadBufferedAsyncCore (Memory< byte > destination)
 
ValueTask CopyFromBufferAsync (Stream destination, bool async, int count, CancellationToken cancellationToken)
 
Task CopyToUntilEofAsync (Stream destination, bool async, int bufferSize, CancellationToken cancellationToken)
 
async Task CopyToUntilEofWithExistingBufferedDataAsync (Stream destination, bool async, int bufferSize, CancellationToken cancellationToken)
 
async Task CopyToContentLengthAsync (Stream destination, bool async, ulong length, int bufferSize, CancellationToken cancellationToken)
 
void CompleteResponse ()
 
void ReturnConnectionToPool ()
 

Static Private Member Functions

static bool IsLineEmpty (ReadOnlyMemory< byte > line)
 
static void ParseStatusLine (ReadOnlySpan< byte > line, HttpResponseMessage response)
 
static void ParseHeaderNameValue (HttpConnection connection, ReadOnlySpan< byte > line, HttpResponseMessage response, bool isFromTrailer)
 
static bool EqualsOrdinal (string left, ReadOnlySpan< byte > right)
 

Private Attributes

readonly HttpConnectionPool _pool
 
readonly Socket _socket
 
readonly Stream _stream
 
readonly TransportContext _transportContext
 
readonly WeakReference< HttpConnection_weakThisRef
 
HttpRequestMessage _currentRequest
 
readonly byte[] _writeBuffer
 
int _writeOffset
 
int _allowedReadLineBytes
 
string[] _headerValues = Array.Empty<string>()
 
ValueTask< int >? _readAheadTask
 
int _readAheadTaskLock
 
byte[] _readBuffer
 
int _readOffset
 
int _readLength
 
long _idleSinceTickCount
 
bool _inUse
 
bool _detachedFromPool
 
bool _canRetry
 
bool _startedSendingRequestBody
 
bool _connectionClose
 
int _disposed
 
string _lastDateHeaderValue
 
string _lastServerHeaderValue
 
readonly long _creationTickCount = Environment.TickCount64
 

Static Private Attributes

static readonly byte[] s_contentLength0NewlineAsciiBytes = Encoding.ASCII.GetBytes("Content-Length: 0\r\n")
 
static readonly byte[] s_spaceHttp10NewlineAsciiBytes = Encoding.ASCII.GetBytes(" HTTP/1.0\r\n")
 
static readonly byte[] s_spaceHttp11NewlineAsciiBytes = Encoding.ASCII.GetBytes(" HTTP/1.1\r\n")
 
static readonly byte[] s_httpSchemeAndDelimiter = Encoding.ASCII.GetBytes(Uri.UriSchemeHttp + Uri.SchemeDelimiter)
 
static readonly byte[] s_http1DotBytes = Encoding.ASCII.GetBytes("HTTP/1.")
 
static readonly ulong s_http10Bytes = BitConverter.ToUInt64(Encoding.ASCII.GetBytes("HTTP/1.0"))
 
static readonly ulong s_http11Bytes = BitConverter.ToUInt64(Encoding.ASCII.GetBytes("HTTP/1.1"))
 

Detailed Description

Definition at line 16 of file HttpConnection.cs.


The documentation for this class was generated from the following file: