TcpClient.ReceiveTimeout Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the amount of time a TcpClient will wait to receive data once a read operation is initiated.

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

member ReceiveTimeout : int with get, set

Property Value

Type: System.Int32

The time-out value of the connection in milliseconds. The default value is 0.

The ReceiveTimeout property determines the amount of time that the Read method will block until it is able to receive data. This time is measured in milliseconds. If the time-out expires before Read successfully completes, TcpClient throws a IOException. There is no time-out by default.

The following code example sets and gets the receive time out.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top