TcpClient.SendTimeout Property

 

Gets or sets the amount of time a TcpClient will wait for a send operation to complete successfully.

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

member SendTimeout : int with get, set

Property Value

Type: System.Int32

The send time-out value, in milliseconds. The default is 0.

The SendTimeout property determines the amount of time that the Send method will block until it is able to return successfully. This time is measured in milliseconds.

After you call the Write method, the underlying Socket returns the number of bytes actually sent to the host. The SendTimeout property determines the amount of time a TcpClient will wait before receiving the number of bytes returned. If the time-out expires before the Send method successfully completes, TcpClient will throw a SocketException. There is no time-out by default.

The following code example sets and gets the SendTimeout value.

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

.NET Framework
Available since 1.1
Return to top
Show: