Closed luck02 closed 8 years ago
Addendum:
timeouts.ReadIntervalTimeout = MAXDWORD
timeouts.ReadTotalTimeoutMultiplier = 0
timeouts.ReadTotalTimeoutConstant = 0 // MAXDWORD - 1
Makes the read call return instantly, but with a different error.
one windows we get: "multiple Read calls return no data or error" On OSX we get: "EOF"
I think we can map the options struct intelligently to windows. I'll submit a PR in the near future.
Also, ideally it would be nice to return the same error regardless of platform. EOF / Multiple reads isn't really an error, it's just saying there were no bytes on the port. I'll think about that, would appreciate any insight.
G
Updated PR: https://github.com/jacobsa/go-serial/pull/16
this has been merged by @jacobsa
On OSX I have a working integration test that relies on IO timeouts. I want to issue a read, then after a set amount of time cancel that read.
This works on OSX, but on windows it seems the read blocks indefinitly.
When I look at the windows code I see that it seems to ignore the options struct while setting timeouts.
Just wondering if you had any background on that.
That doesn't seem to take the options struct at all into account.
Any thoughts?
Thanks!