Implement vecnet.ReadFrom on Windows #54
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implementation is mostly copied from the Linux version, with types and methods being adjusted for Windows.
I wrote a test which covers this and passes, but I'm not sure how correct it is.
The main concern is if the calls to
WriteMsgUDP
would ever block. If they do, this could just be wrapped in a goroutine.Maybe that happens on larger messages? Maybe the test should send 9P-messages instead of arbitrary []bytes?
Outside of this though, I'm not sure how it compares to the existing
io.Read
fallback invecnet.ReadFrom(reader)
.Both in terms of performance or correctness.
I'll leave this as a draft until it's tested a little better with implementations that use the library across Windows<->Linux machines.
As long as they appear to comply and the performance isn't worse, it should be okay I guess?
Edit: I'm getting hangs during
Attach
sometimes. Maybe it's the opposite of above, small messages don't ever get flushed from the buffers?Not sure but not good enough to be considered stable. (*Could always have been a problem in my server implementation too.)