Attempted to fix blocking example to work with non-synced duplex streams. #78
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.
Ok, I think this might fix #72 now! @niclashoyer
I have a feeling it might be because the blocking.rs example wasn't properly handling non-synced duplex streams.
For example, on my device there is always consistently the exact number of frames available for reading and writing as the number that the stream is set up with (256 in the example) and they are always available in consecutive order (which is why passing input buffer directly to the output worked). However in your case it seems get_available just returns what is available at that exact moment and not necessarily in a synchronised order. The changes I made to the blocking.rs example in this PR should address this (hopefully!).
Let me know how it goes!