Gets or sets the amount of time a TcpClient will wait for a send operation to complete successfully.
Assembly: System (in System.dll)
The Send method will block until it is able to return successfully. This time is measured in milliseconds.property determines the amount of time that the
After you call the Write method, the underlying Socket returns the number of bytes actually sent to the host. The 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 thevalue.
// sets the send time out using the SendTimeout public property. tcpClient.SendTimeout = 5; // gets the send time out using the SendTimeout public property. if (tcpClient.SendTimeout == 5) Console.WriteLine ("The send time out limit was successfully set " + tcpClient.SendTimeout.ToString ());
Available since 10
Available since 1.1