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

Added MultiplexedStreamReader #473

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

The-TT-Hacker
Copy link

Added a simple reader for the multiplexed stream used for getting logs from containers which can read lines as strings. Also works with the service logs pull request i've made.
Ideally the multiplex stream would extend the stream class or something so we can use the normal stream reader but this is working for me.

var line = new List<byte>();

var buffer = new byte[1];

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@The-TT-Hacker I tested this method trying to get rid of headers being shown on MonitorStreamAsync method and haven't managed to cancel it.
Would you confirm if expected behaviour is to read until 0 bytes are returned or to stop reading when no more lines are retrieved?
When res equals 0, it loops indefinitelly.
This is test I used
https://gist.github.com/dgvives/2620960049191797ea0d871c339d9bc2#file-program-cs-L1

It would be nice if MultiplexedStreamReader could detect stream being multiplexed and provide output por ReadLineAsync without control chars.

Have you checked this running containers on different platforms? Because of EOL

@ACoderLife
Copy link
Contributor

@galvesribeiro I have updated this one with cancellation support.

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

Successfully merging this pull request may close these issues.

None yet

3 participants