Share via


SerialPort.WriteTimeout Property

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

Namespace: System.IO.Ports
Assembly: Microsoft.SPOT.Hardware (in microsoft.spot.hardware.dll)

Syntax

public int WriteTimeout { get; set; }

Property Value

The number of milliseconds before a time-out occurs. The default is InfiniteTimeout.

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 InfiniteTimeout, in which case no time-out occurs. 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 WriteTimeout property, however, you must specify InfiniteTimeout.

This property does not affect the BeginWrite method of the stream returned by the BaseStream property.

Version Information

Available in the .NET Micro Framework versions 3.0, 4.0, 4.1, and 4.2.

See Also

Reference

SerialPort Class
SerialPort Members
System.IO.Ports Namespace