Share via


DataAvailable Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets a value that indicates whether data is available on the NetworkStream to be read.

Namespace:  System.Net.Sockets
Assembly:  System (in System.dll)

Syntax

'Declaration
Public Overridable ReadOnly Property DataAvailable As Boolean
public virtual bool DataAvailable { get; }
public:
virtual property bool DataAvailable {
    bool get ();
}
abstract DataAvailable : bool with get
override DataAvailable : bool with get
function get DataAvailable () : boolean

Property Value

Type: System. . :: . .Boolean
true if data is available on the stream to be read; otherwise, false.

Remarks

Use the DataAvailable property to determine if data is ready to be read. If DataAvailable is true, a call to Read returns immediately. If the remote host shuts down or closes the connection, DataAvailable may throw a SocketException.

.NET Framework Security

See Also

Reference

NetworkStream Class

System.Net.Sockets Namespace