Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non blocking mode undesiderable behavior #31

Closed
paocalvi opened this issue Nov 10, 2015 · 0 comments
Closed

Non blocking mode undesiderable behavior #31

paocalvi opened this issue Nov 10, 2015 · 0 comments

Comments

@paocalvi
Copy link

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

@tarm tarm closed this as completed in 0b54e01 Nov 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant