You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tested in WINDOWS 7 64 bit.
The non-blocking mode behaves in a weird way. If you set the ReadTimeout to 5 seconds, it waits IN ANY CASE, input arriving or not 5 seconds before giving the data out. This is due to
timeouts.ReadIntervalTimeout = 0
timeouts.ReadTotalTimeoutMultiplier = 0
timeouts.ReadTotalTimeoutConstant = uint32(timeoutMs)
While these may be the desired behavior, probably what people wants when setting a timeout is having the data immediately unless the timeout passes without ANY data. This can be achieved with:
timeouts.ReadIntervalTimeout = MAXDWORD
timeouts.ReadTotalTimeoutMultiplier = MAXDWORD
timeouts.ReadTotalTimeoutConstant = uint32(timeoutMs)
I suggest to modify the code or to add a flag to decide which is the wanted behavior.
Thanks for the great job.
Paolo
The text was updated successfully, but these errors were encountered:
Tested in WINDOWS 7 64 bit.
The non-blocking mode behaves in a weird way. If you set the ReadTimeout to 5 seconds, it waits IN ANY CASE, input arriving or not 5 seconds before giving the data out. This is due to
timeouts.ReadIntervalTimeout = 0
timeouts.ReadTotalTimeoutMultiplier = 0
timeouts.ReadTotalTimeoutConstant = uint32(timeoutMs)
While these may be the desired behavior, probably what people wants when setting a timeout is having the data immediately unless the timeout passes without ANY data. This can be achieved with:
timeouts.ReadIntervalTimeout = MAXDWORD
timeouts.ReadTotalTimeoutMultiplier = MAXDWORD
timeouts.ReadTotalTimeoutConstant = uint32(timeoutMs)
I suggest to modify the code or to add a flag to decide which is the wanted behavior.
Thanks for the great job.
Paolo
The text was updated successfully, but these errors were encountered: