SetPortTimeOuts

BOOL (WINAPI *pfnSetPortTimeOuts)(

HANDLE hPort,
LPCOMMTIMEOUTS lpCTO,
DWORD reserved
);

SetPortTimeOuts sets timeout values on an open port.

Parameters

hPort

Handle to the open port on which to set the timeout values.

lpCTO

Points to a Win32 COMMTIMEOUTS structure that contains the timeout values to set.

reserved

Reserved for future use. Must be set to zero.

Return Value

SetPortTimeOuts returns TRUE if it succeeds; otherwise, it returns FALSE.

Comments

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.

See Also

OpenPort