SslStream.CanTimeout 属性

定义

获取一个 Boolean 值,该值指示基础流是否支持超时。

public:
 virtual property bool CanTimeout { bool get(); };
public override bool CanTimeout { get; }
member this.CanTimeout : bool
Public Overrides ReadOnly Property CanTimeout As Boolean

属性值

如果基础流支持超时,则为 true;否则为 false

示例

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

static void DisplayStreamProperties( SslStream^ stream )
{
   Console::WriteLine( L"Can read: {0}, write {1}", stream->CanRead, stream->CanWrite );
   Console::WriteLine( L"Can timeout: {0}", stream->CanTimeout );
}
static void DisplayStreamProperties(SslStream stream)
{
   Console.WriteLine("Can read: {0}, write {1}", stream.CanRead, stream.CanWrite);
   Console.WriteLine("Can timeout: {0}", stream.CanTimeout);
}
Private Shared Sub DisplayStreamProperties(stream As SslStream)
    Console.WriteLine("Can read: {0}, write {1}", stream.CanRead, stream.CanWrite)
    Console.WriteLine("Can timeout: {0}", stream.CanTimeout)
End Sub

注解

此属性返回通过调用 CanTimeout 基础流返回的值。

基础流是在创建 类的 SslStream 实例时指定的。

适用于