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

fix: close muxed streams when underlying socket is closed #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

daviddias
Copy link
Collaborator

Hi all!

We've been updating our libp2p-multiplex wrap (exposing pull-streams instead of Node.js streams and conforming with the interface defined on https://github.com/libp2p/interface-stream-muxer) and found that one of our expectations that is met with spdy-transport, wasn't met with multiplex, that is:

  • 'when the underlying socket is closed, every stream should be closed as well'.

This PR changes multiplex so that it does that.

In addition to this, we learned that now multiplex also passes our 'mega stress test', which previously would make multiplex error with OOM thrown.

I've added a test for this new behaviour. One Caveat is that now, since errors are propagated, you have to listen for errors on each stream, otherwise they will be process unCaught exceptions, I've updated the test 'overflow' because of this.

@victorb
Copy link

victorb commented Jan 19, 2017

Should close #25 and maybe #31 and #16 as well

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

2 participants