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

◆ DrainOnDisposeAsync()

async Task System.Net.Http.HttpConnection.HttpContentReadStream.DrainOnDisposeAsync ( )
inlineprivate

Definition at line 802 of file HttpConnection.cs.

803 {
804 HttpConnection connection = _connection;
805 try
806 {
807 bool flag = await DrainAsync(connection._pool.Settings._maxResponseDrainSize).ConfigureAwait(continueOnCapturedContext: false);
808 if (System.Net.NetEventSource.Log.IsEnabled())
809 {
810 connection.Trace(flag ? "Connection drain succeeded" : $"Connection drain failed when MaxResponseDrainSize={connection._pool.Settings._maxResponseDrainSize} bytes or MaxResponseDrainTime=={connection._pool.Settings._maxResponseDrainTime} exceeded", "DrainOnDisposeAsync");
811 }
812 }
813 catch (Exception value)
814 {
815 if (System.Net.NetEventSource.Log.IsEnabled())
816 {
817 connection.Trace($"Connection drain failed due to exception: {value}", "DrainOnDisposeAsync");
818 }
819 }
820 base.Dispose(disposing: true);
821 }
virtual ValueTask< bool > DrainAsync(int maxDrainBytes)
HttpConnection(HttpConnectionPool pool, Socket socket, Stream stream, TransportContext transportContext)
static readonly System.Net.NetEventSource Log

References System.Net.Http.HttpContentStream._connection, System.Net.Http.HttpConnectionSettings._maxResponseDrainSize, System.Net.Http.HttpConnection._pool, System.Net.Http.HttpConnection.HttpContentReadStream.DrainAsync(), System.Net.NetEventSource.Log, System.Net.Http.HttpConnectionPool.Settings, System.Net.Http.HttpConnection.Trace(), and System.value.

Referenced by System.Net.Http.HttpConnection.HttpContentReadStream.Dispose().