NetworkStream.CanWrite Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a value that indicates whether the NetworkStream supports writing.
public:
virtual property bool CanWrite { bool get(); };
public override bool CanWrite { get; }
member this.CanWrite : bool
Public Overrides ReadOnly Property CanWrite As Boolean
Property Value
true
if data can be written to the NetworkStream; otherwise, false
. The default value is true
.
Remarks
If CanWrite is true
, NetworkStream allows calls to the Write method. Provide the appropriate FileAccess enumerated value in the constructor to set the readability and writability of the NetworkStream.
Note
The CanWrite property is set when the NetworkStream is initialized. Changes in the underlying Socket's state (eg. closure) do not affect the value of CanWrite.