本文整理汇总了C#中System.Net.ServicePoint.SubmitRequest方法的典型用法代码示例。如果您正苦于以下问题:C# ServicePoint.SubmitRequest方法的具体用法?C# ServicePoint.SubmitRequest怎么用?C# ServicePoint.SubmitRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Net.ServicePoint
的用法示例。
在下文中一共展示了ServicePoint.SubmitRequest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SubmitRequest
private void SubmitRequest(ServicePoint servicePoint)
{
GlobalLog.Enter("HttpWebRequest#" + ValidationHelper.HashString(this) + "::SubmitRequest");
GlobalLog.ThreadContract(ThreadKinds.Unknown, "HttpWebRequest#" + ValidationHelper.HashString(this) + "::SubmitRequest");
GlobalLog.Print("HttpWebRequest#" + ValidationHelper.HashString(this) + "::SubmitRequest() HaveResponse:" + HaveResponse + " Saw100Continue:" + Saw100Continue);
if (!Async)
{
_ConnectionAResult = new LazyAsyncResult(this, null, null);
_ConnectionReaderAResult = new LazyAsyncResult(this, null, null);
OpenWriteSideResponseWindow();
}
if (_Timer == null && !Async){
_Timer = TimerQueue.CreateTimer(s_TimeoutCallback, this);
}
try {
if (_SubmitWriteStream != null && _SubmitWriteStream.IsPostStream)
{
// _OldSubmitWriteStream is the stream that holds real user data
// In no case it can be overwritten.
// For multiple resubmits the ContentLength was set already, so no need call it again.
// on first resubmission the real user data hasn't been saved, so _OldSubmitWriteStream is null
GlobalLog.Print("HttpWebRequest#" + ValidationHelper.HashString(this) + "::SubmitRequest() (resubmit) firstResubmission:" + (_OldSubmitWriteStream == null) + " NtlmKeepAlive:" + NtlmKeepAlive);
if (_OldSubmitWriteStream == null && !_SubmitWriteStream.ErrorInStream && AllowWriteStreamBuffering)
{
// save the real user data.
GlobalLog.Print("HttpWebRequest#" + ValidationHelper.HashString(this) + "::SubmitRequest() (resubmit) save the real user data _OldSubmitWriteStream#" + ValidationHelper.HashString(_OldSubmitWriteStream));
_OldSubmitWriteStream = _SubmitWriteStream;
}
// make sure we reformat the headers before resubmitting
_WriteBuffer = null;
}
m_Retry = false;
// If pre-authentication is requested call the AuthenticationManager
// and add authorization header if there is response
if (PreAuthenticate) {
if (UsesProxySemantics && _Proxy != null && _Proxy.Credentials != null)
ProxyAuthenticationState.PreAuthIfNeeded(this, _Proxy.Credentials);
if (Credentials != null)
ServerAuthenticationState.PreAuthIfNeeded(this, Credentials);
}
if (WriteBuffer == null) {
UpdateHeaders();
}
if (CheckCacheRetrieveBeforeSubmit()) {
// We are done and internal Response processing is kicked in
GlobalLog.Leave("HttpWebRequest#" + ValidationHelper.HashString(this) + "::SubmitRequest CACHED RESPONSE");
return;
}
// At this point we are going to send a live request
// _AbortDelegate is set on submission process.
servicePoint.SubmitRequest(this, GetConnectionGroupLine());
}
finally {
if (!Async)
CheckWriteSideResponseProcessing();
}
GlobalLog.Leave("HttpWebRequest#" + ValidationHelper.HashString(this) + "::SubmitRequest");
}