Share via


SerialPort.ReadTimeout Property

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

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

Syntax

public int ReadTimeout { get; set; }

Property Value

The read 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 ReadTimeout property, however, you must specify InfiniteTimeout.

This property does not affect the BeginRead 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