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

◆ OpenWriteAsync() [3/3]

void System.Net.WebClient.OpenWriteAsync ( Uri address,
string? method,
object? userToken )
inline

Definition at line 1492 of file WebClient.cs.

1493 {
1494 ArgumentNullException.ThrowIfNull(address, "address");
1495 if (method == null)
1496 {
1497 method = MapToDefaultMethod(address);
1498 }
1499 AsyncOperation asyncOp = StartAsyncOperation(userToken);
1500 try
1501 {
1502 _method = method;
1503 WebRequest request = (_webRequest = GetWebRequest(GetUri(address)));
1504 request.BeginGetRequestStream(delegate(IAsyncResult iar)
1505 {
1506 WebClientWriteStream result = null;
1507 Exception exception = null;
1508 try
1509 {
1510 result = new WebClientWriteStream(request.EndGetRequestStream(iar), request, this);
1511 }
1512 catch (Exception ex2) when (!(ex2 is OutOfMemoryException))
1513 {
1515 }
1516 InvokeOperationCompleted(asyncOp, _openWriteOperationCompleted, new OpenWriteCompletedEventArgs(result, exception, _canceled, asyncOp.UserSuppliedState));
1517 }, null);
1518 }
1519 catch (Exception ex) when (!(ex is OutOfMemoryException))
1520 {
1521 OpenWriteCompletedEventArgs eventArgs = new OpenWriteCompletedEventArgs(null, GetExceptionToPropagate(ex), _canceled, asyncOp.UserSuppliedState);
1523 }
1524 }
SendOrPostCallback _openWriteOperationCompleted
Definition WebClient.cs:102
Uri GetUri(string address)
Definition WebClient.cs:990
virtual WebRequest GetWebRequest(Uri address)
Definition WebClient.cs:428
WebRequest _webRequest
Definition WebClient.cs:76
static Exception GetExceptionToPropagate(Exception e)
AsyncOperation StartAsyncOperation(object userToken)
Definition WebClient.cs:366
string MapToDefaultMethod(Uri address)
void InvokeOperationCompleted(AsyncOperation asyncOp, SendOrPostCallback callback, AsyncCompletedEventArgs eventArgs)

References System.Net.WebClient._canceled, System.Net.WebClient._method, System.Net.WebClient._openWriteOperationCompleted, System.Net.WebClient._webRequest, System.Net.WebRequest.BeginGetRequestStream(), System.Net.WebRequest.EndGetRequestStream(), System.exception, System.Net.WebClient.GetExceptionToPropagate(), System.Net.WebClient.GetUri(), System.Net.WebClient.GetWebRequest(), System.Net.WebClient.InvokeOperationCompleted(), System.Net.WebClient.MapToDefaultMethod(), System.Net.WebClient.StartAsyncOperation(), System.ArgumentNullException.ThrowIfNull(), and System.ComponentModel.AsyncOperation.UserSuppliedState.