System.IO.Ports.SerialPort.WriteTimeout Property

Gets or sets the number of milliseconds before a time-out occurs when a write operation does not finish.

Syntax

[System.ComponentModel.Browsable(true)]
[System.ComponentModel.DefaultValue(-1)]
[System.Diagnostics.MonitoringDescription("")]
public int WriteTimeout { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

The write time-out value was originally set at 500 milliseconds in the Win32 Communications API. This property allows you to set this value. The time-out can be set to any value greater than zero, or set to SerialPort.InfiniteTimeout, in which case no time-out occurs. SerialPort.InfiniteTimeout is the default.

Note:

Users of the unmanaged COMMTIMEOUTS structure might expect to set the time-out value to zero to suppress time-outs. To suppress time-outs with the SerialPort.WriteTimeout property, however, you must specify SerialPort.InfiniteTimeout.

This property does not affect the System.IO.Stream.BeginWrite(Byte[], int, int, AsyncCallback, object) method of the stream returned by the SerialPort.BaseStream property.

Requirements

Namespace: System.IO.Ports
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0