ServicePoint.SupportsPipelining 属性

定义

指示 ServicePoint 对象是否支持管道连接。

public:
 property bool SupportsPipelining { bool get(); };
public bool SupportsPipelining { get; }
member this.SupportsPipelining : bool
Public ReadOnly Property SupportsPipelining As Boolean

属性值

如果 ServicePoint 对象支持管道连接,则 true;否则,false

示例

下面的代码示例显示此属性的值。

if ( sp->Certificate == nullptr )
   Console::WriteLine( "Certificate = (null)" );
else
   Console::WriteLine( "Certificate = {0}", sp->Certificate );

if ( sp->ClientCertificate == nullptr )
   Console::WriteLine( "Client Certificate = (null)" );
else
   Console::WriteLine( "Client Certificate = {0}", sp->ClientCertificate );

Console::WriteLine( "ProtocolVersion = {0}", sp->ProtocolVersion->ToString() );
Console::WriteLine( "SupportsPipelining = {0}", sp->SupportsPipelining );
if (sp.Certificate == null)
    Console.WriteLine("Certificate = (null)");
else
    Console.WriteLine("Certificate = " + sp.Certificate.ToString());

if (sp.ClientCertificate == null)
    Console.WriteLine("ClientCertificate = (null)");
else
    Console. WriteLine("ClientCertificate = " + sp.ClientCertificate.ToString());

Console.WriteLine("ProtocolVersion = " + sp.ProtocolVersion.ToString());
Console.WriteLine("SupportsPipelining = " + sp.SupportsPipelining);
If sp.Certificate Is Nothing Then
    Console.WriteLine("Certificate = (null)")
Else
    Console.WriteLine(("Certificate = " + sp.Certificate.ToString()))
End If

If sp.ClientCertificate Is Nothing Then
    Console.WriteLine("ClientCertificate = (null)")
Else
    Console.WriteLine(("ClientCertificate = " + sp.ClientCertificate.ToString()))
End If

Console.WriteLine("ProtocolVersion = " + sp.ProtocolVersion.ToString())
Console.WriteLine(("SupportsPipelining = " + sp.SupportsPipelining.ToString()))

注解

谨慎

WebRequestHttpWebRequestServicePointWebClient 已过时,不应将其用于新开发。 请改用 HttpClient

通过管道传送,客户端可以在持久性连接之间发送多个请求,而无需等待来自服务器的每个响应。 服务器按接收请求的顺序发送响应。

IETF RFC 2616 第 8.1.2.2 部分详细介绍了管道传送。

适用于