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

◆ BeginGetRequestStream()

override IAsyncResult System.Net.FtpWebRequest.BeginGetRequestStream ( AsyncCallback? callback,
object? state )
inlinevirtual

Reimplemented from System.Net.WebRequest.

Definition at line 736 of file FtpWebRequest.cs.

737 {
738 if (System.Net.NetEventSource.Log.IsEnabled())
739 {
740 System.Net.NetEventSource.Info(this, $"Method: {_methodInfo.Method}", "BeginGetRequestStream");
741 }
742 ContextAwareResult contextAwareResult = null;
743 try
744 {
746 {
748 }
751 {
752 throw new ProtocolViolationException(System.SR.net_nouploadonget);
753 }
754 CheckError();
755 FinishRequestStage(RequestStage.RequestStarted);
756 contextAwareResult = new ContextAwareResult(captureIdentity: true, forceCaptureContext: true, this, state, callback);
757 lock (contextAwareResult.StartPostingAsyncOp())
758 {
759 _writeAsyncResult = contextAwareResult;
760 SubmitRequest(isAsync: true);
761 contextAwareResult.FinishPostingAsyncOp();
762 FinishRequestStage(RequestStage.CheckForError);
763 return contextAwareResult;
764 }
765 }
766 catch (Exception message)
767 {
768 if (System.Net.NetEventSource.Log.IsEnabled())
769 {
770 System.Net.NetEventSource.Error(this, message, "BeginGetRequestStream");
771 }
772 throw;
773 }
774 }
void SubmitRequest(bool isAsync)
RequestStage FinishRequestStage(RequestStage stage)
ContextAwareResult _writeAsyncResult
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
static void Error(object thisOrContextObject, FormattableString formattableString, [CallerMemberName] string memberName=null)
static string net_nouploadonget
Definition SR.cs:36
static string net_repcall
Definition SR.cs:38
Definition SR.cs:7

References System.Net.FtpWebRequest._getRequestStreamStarted, System.Net.FtpWebRequest._methodInfo, System.Net.FtpWebRequest._writeAsyncResult, System.Net.FtpWebRequest.CheckError(), System.Net.NetEventSource.Error(), System.Net.ContextAwareResult.FinishPostingAsyncOp(), System.Net.FtpWebRequest.FinishRequestStage(), System.Net.NetEventSource.Info(), System.Net.FtpMethodInfo.IsUpload, System.Net.NetEventSource.Log, System.SR.net_nouploadonget, System.SR.net_repcall, System.Net.ContextAwareResult.StartPostingAsyncOp(), System.state, and System.Net.FtpWebRequest.SubmitRequest().