다음을 통해 공유


HttpWebRequest.Pipelined 속성

정의

인터넷 리소스에 요청을 파이프라인할지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 property bool Pipelined { bool get(); void set(bool value); };
public bool Pipelined { get; set; }
member this.Pipelined : bool with get, set
Public Property Pipelined As Boolean

속성 값

요청을 파이프라인해야 하는지 true. 그렇지 않으면 false. 기본값은 true.

예제

다음 코드 예제에서는 콘솔에 Pipelined 속성의 값을 인쇄 합니다.

// Create a 'HttpWebRequest' object.
HttpWebRequest^ myHttpWebRequest = (HttpWebRequest^)( WebRequest::Create( myUri ) );
// Assign the response object of 'HttpWebRequest' to a 'HttpWebResponse' variable.
HttpWebResponse^ myHttpWebResponse = (HttpWebResponse^)( myHttpWebRequest->GetResponse() );
// Display the contents of the page to the console.
Stream^ streamResponse = myHttpWebResponse->GetResponseStream();
StreamReader^ streamRead = gcnew StreamReader( streamResponse );
array<Char>^ readBuffer = gcnew array<Char>(256);
int count = streamRead->Read( readBuffer, 0, 256 );
Console::WriteLine( "\nThe contents of HTML page are......." );
while ( count > 0 )
{
   String^ outputData = gcnew String( readBuffer,0,count );
   Console::Write( outputData );
   count = streamRead->Read( readBuffer, 0, 256 );
}
Console::WriteLine( "\nHTTP Request  Headers :\n\n {0}", myHttpWebRequest->Headers );
Console::WriteLine( "\nHTTP Response Headers :\n\n {0}", myHttpWebResponse->Headers );
streamRead->Close();
streamResponse->Close();
// Release the response object resources.
myHttpWebResponse->Close();
Console::WriteLine( "\n'Pipelined' property is: {0}", myHttpWebRequest->Pipelined );
Console::WriteLine( "\nPress 'Enter' Key to Continue......" );
Console::Read();
// Create a 'HttpWebRequest' object.
HttpWebRequest	myHttpWebRequest=(HttpWebRequest)WebRequest.Create(myUri);
// Assign the response object of 'HttpWebRequest' to a 'HttpWebResponse' variable.
HttpWebResponse myHttpWebResponse=(HttpWebResponse)myHttpWebRequest.GetResponse();
// Display the contents of the page to the console.
Stream streamResponse=myHttpWebResponse.GetResponseStream();
StreamReader streamRead = new StreamReader( streamResponse );
Char[] readBuffer = new Char[256];
int count = streamRead.Read( readBuffer, 0, 256 );
Console.WriteLine("\nThe contents of HTML page are.......");	
while (count > 0)
{
    String outputData = new String(readBuffer, 0, count);
    Console.Write(outputData);
    count = streamRead.Read(readBuffer, 0, 256);
}
Console.WriteLine("\nHTTP Request  Headers :\n\n{0}",myHttpWebRequest.Headers);
Console.WriteLine("\nHTTP Response Headers :\n\n{0}",myHttpWebResponse.Headers);
streamRead.Close();
streamResponse.Close();
// Release the response object resources.
myHttpWebResponse.Close();
Console.WriteLine("\n'Pipelined' property is:{0}",myHttpWebRequest.Pipelined);	
Console.WriteLine("\nPress 'Enter' Key to Continue......");
Console.Read();
' Create a 'HttpWebRequest' object.
Dim myHttpWebRequest As HttpWebRequest = CType(WebRequest.Create(myUri), HttpWebRequest)
' Assign the response object of 'HttpWebRequest' to a 'HttpWebResponse' variable.
Dim myHttpWebResponse As HttpWebResponse = CType(myHttpWebRequest.GetResponse(), HttpWebResponse)
' Display the contents of the page to the console
Dim streamResponse As Stream = myHttpWebResponse.GetResponseStream()
Dim streamRead As New StreamReader(streamResponse)
Dim readBuffer(256) As [Char]
Dim count As Integer = streamRead.Read(readBuffer, 0, 256)
Console.WriteLine(ControlChars.Cr + "The contents of HTML page are.......")
While count > 0
    Dim outputData As New [String](readBuffer, 0, count)
    Console.Write(outputData)
    count = streamRead.Read(readBuffer, 0, 256)
End While
Console.WriteLine(ControlChars.Cr + "HTTP Request  Headers :" + ControlChars.Cr + ControlChars.Cr + "{0}", myHttpWebRequest.Headers)
Console.WriteLine(ControlChars.Cr + "HTTP Response Headers :" + ControlChars.Cr + ControlChars.Cr + "{0}", myHttpWebResponse.Headers)
streamRead.Close()
 streamResponse.Close()
' Release the response object resources.
myHttpWebResponse.Close()
Console.WriteLine(ControlChars.Cr + "'Pipelined' property is:{0}", myHttpWebRequest.Pipelined)
Console.WriteLine(ControlChars.Cr + "Press 'Enter' Key to Continue......")
Console.Read()

설명

주의

WebRequest, HttpWebRequest, ServicePointWebClient 사용되지 않으므로 새 개발에 사용하면 안 됩니다. 대신 HttpClient 사용합니다.

애플리케이션은 Pipelined 속성을 사용하여 파이프라인된 연결에 대한 기본 설정을 나타냅니다. Pipelined true애플리케이션은 이를 지원하는 서버에 파이프라인된 연결을 만듭니다.

파이프라인 연결은 KeepAlive 속성도 true경우에만 이루어집니다.

적용 대상