System.Net.Sockets.TcpClient.Available Property

Gets the amount of data that has been received from the network and is available to be read.

Syntax

public int Available { get; }

Value

Documentation for this section has not yet been entered.

Remarks

TcpClient.Available is a way to determine whether data is queued for reading. If data is available, call NetworkStream.Read(Byte[], int, int) to get the data. The available data is the total amount of data queued in the network buffer for reading. If no data is queued in the network buffer, TcpClient.Available returns 0.

If the remote host shuts down or closes the connection, TcpClient.Available may throw a System.Net.Sockets.SocketException. If you receive a System.Net.Sockets.SocketException, use SocketException.ErrorCode to obtain the specific error code. After you have obtained this code, you can refer to the Windows Sockets version 2 API error code documentation in the MSDN library at tp://msdn.microsoft.com/library. for a detailed description of the error.

Requirements

Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0