NetworkStream.CanRead Property

Definition

Gets a value that indicates whether the NetworkStream supports reading.

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 data can be read from the stream; otherwise, false. The default value is true.

Remarks

If CanRead is true, NetworkStream allows calls to the Read method. Provide the appropriate FileAccess enumerated value in the constructor to set the readability and writability of the NetworkStream.

Note

The CanRead property is set when the NetworkStream is initialized. Changes in the underlying Socket's state (eg. closure) do not affect the value of CanRead.

Applies to

See also