SetTimeouts method sets timeouts for virtual serial port. Timeout values set by Application are overridden


BOOL SetTimeouts(

      LONG ReadIntervalTimeout,      

      LONG ReadTotalTimeoutMultiplier,      

      LONG ReadTotalTimeoutConstant,      

      LONG WriteTotalTimeoutMultiplier,      

      LONG WriteTotalTimeoutConstant      

);

 

Parameters:

  • ReadIntervalTimeout [in] : Maximum time, in milliseconds, allowed to elapse between the arrival of two characters on the communications line.
  • ReadTotalTimeoutMultiplier [in] : Multiplier, in milliseconds, used to calculate the total timeout period for read operations. For each read operation, this value is multiplied by the requested number of bytes to be read.
  • ReadTotalTimeoutConstant [in] : Constant, in milliseconds, used to calculate the total timeout period for read operations. For each read operation, this value is added to the product of the ReadTotalTimeoutMultiplier member and the requested number of bytes.
  • WriteTotalTimeoutMultiplier [in] : Multiplier, in milliseconds, used to calculate the total timeout period for write operations. For each write operation, this value is multiplied by the number of bytes to be written.
  • WriteTotalTimeoutConstant [in] : Constant, in milliseconds, used to calculate the total timeout period for write operations. For each write operation, this value is added to the product of the WriteTotalTimeoutMultiplier member and the number of bytes to be written.
Note: Timeouts values set by the current method will affect the virtual ports that were already created as well as the ones that will be added in future.

Return Values : If the function succeeds, the return value is TRUE, otherwise the return value is FALSE.

Note: this method is available starting from Windows 2000 only.