BOOL (WINAPI *pfnSetPortTimeOuts)(
HANDLE hPort, | |
LPCOMMTIMEOUTS lpCTO, | |
DWORD reserved | |
); |
SetPortTimeOuts sets timeout values on an open port.
SetPortTimeOuts returns TRUE if it succeeds; otherwise, it returns FALSE.
To avoid hung or unreasonably delayed port responses, port monitors should always establish reasonable time-outs before actually calling a port. Port timeouts can also be established with the one-time port initializations performed by OpenPort.
The communications timeout structure, COMMTIMEOUTS, is defined in the Win32 SDK.
Port monitors and LMPMs can optionally implement SetPortTimeOuts. Language monitors should not implement this function because it performs port management. A language monitor can call a port monitor’s implementation.