Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DelegatingHandler.cs
Go to the documentation of this file.
4
5namespace System.Net.Http;
6
7public abstract class DelegatingHandler : HttpMessageHandler
8{
10
11 private volatile bool _operationStarted;
12
13 private volatile bool _disposed;
14
16 {
17 get
18 {
19 return _innerHandler;
20 }
21 [param: DisallowNull]
22 set
23 {
24 if (value == null)
25 {
26 throw new ArgumentNullException("value");
27 }
29 if (System.Net.NetEventSource.Log.IsEnabled())
30 {
31 System.Net.NetEventSource.Associate(this, value, "InnerHandler");
32 }
34 }
35 }
36
38 {
39 }
40
41 protected DelegatingHandler(HttpMessageHandler innerHandler)
42 {
43 InnerHandler = innerHandler;
44 }
45
47 {
48 if (request == null)
49 {
51 }
53 return _innerHandler.Send(request, cancellationToken);
54 }
55
57 {
58 if (request == null)
59 {
61 }
64 }
65
66 protected override void Dispose(bool disposing)
67 {
68 if (disposing && !_disposed)
69 {
70 _disposed = true;
71 if (_innerHandler != null)
72 {
74 }
75 }
76 base.Dispose(disposing);
77 }
78
79 private void CheckDisposed()
80 {
81 if (_disposed)
82 {
83 throw new ObjectDisposedException(GetType().ToString());
84 }
85 }
86
95
96 private void SetOperationStarted()
97 {
99 if (_innerHandler == null)
100 {
102 }
104 {
105 _operationStarted = true;
106 }
107 }
108}
DelegatingHandler(HttpMessageHandler innerHandler)
override HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken)
override Task< HttpResponseMessage > SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
override void Dispose(bool disposing)
Task< HttpResponseMessage > SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
virtual HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken)
virtual void Dispose(bool disposing)
static readonly System.Net.NetEventSource Log
static void Associate(object first, object second, [CallerMemberName] string memberName=null)
static string net_http_handler_norequest
Definition SR.cs:70
static string net_http_handler_not_assigned
Definition SR.cs:80
static string net_http_operation_started
Definition SR.cs:56
Definition SR.cs:7