Breyta

Deila með


SslStream.CanRead Property

Definition

Gets a Boolean value that indicates whether the underlying stream is readable.

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

Property Value

true if authentication has occurred and the underlying stream is readable; otherwise false.

Examples

The following code example demonstrates displaying the value of this property.

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

Remarks

If successful authentication has occurred, this property returns the value returned by invoking CanRead on the underlying stream.

The underlying stream is specified when you create an instance of the SslStream class.

Applies to