Coder Social home page Coder Social logo

Comments (3)

achingbrain avatar achingbrain commented on July 18, 2024

When i am using the sendData function of js-libp2p-yamux in JS-libp2p, there's an issue where if the data to be sent exceeds the send window limit, only the send window amount is transmitted, leaving the rest unsent.

This is by design and how backpressure works in Yamux. If the data to be sent exceeds the window limit, the sender should wait for the remote to increase the limit. This lets the remote signal that it's ready to receive more data.

For instance, if we set the send window to 100 and disable processing receive window updates

If you disable processing window updates you'll not know when it's ok to send more data so things won't work as expected.

In my opinion, it should send the entire data as a single package rather than splitting it into two and waiting for the remaining data to send

If you ignore the send window size, the remote would be within it's rights to close the connection since you aren't following the protocol any more.

I suspect it is caused by the behavior of the stream-muxer in the js-libp2p. It continues to send data to the function 'sendData' without waiting for the previous 'sendData' operation to finish.

Are you sure this is true? The AbstractStream superclass awaits on any promise returned from sendData.

If you're seeing something different can you please open a PR with a failing test case that demonstrates the problem?

from js-libp2p.

github-actions avatar github-actions commented on July 18, 2024

Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.

from js-libp2p.

github-actions avatar github-actions commented on July 18, 2024

This issue was closed because it is missing author input.

from js-libp2p.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.