Comments (3)
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.
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.
This issue was closed because it is missing author input.
from js-libp2p.
Related Issues (20)
- Dial queue timeout for multiple multiaddresses incorrectly used for each connection separately HOT 6
- `notifyOnTransient` also ignore disconnection events?
- @libp2p/webtransport Correct multiaddr format HOT 4
- Restarting a node quickly and connecting will not emit `onConnect`events in registrar HOT 2
- dht: kadDHT() causes TypeError: Cannot destructure property 'kBucketSize' of 'init' as it is undefined HOT 4
- Example returns empty object. HOT 4
- Unhandled error: ERR_SDP_HANDSHAKE_ABORTED HOT 2
- Make identify-push autodial smarter
- Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in \node_modules\libp2p\package.json HOT 1
- Docs for `peer-record` are referencing PR i.s.o RFC
- Circuit relay drops connection after minute. HOT 1
- Add documentation for crypto.supportedKeys HOT 1
- AutoDial retries creeps up CPU usage over time
- TypeScript compilation errors within @libp2p/interface/src/event-target.ts
- 30+ Broken links in readme. HOT 3
- WebRTC transport apparently broken in the NodeJS environment HOT 10
- TypeError: peer[0].getPeerId is not a function HOT 4
- Lacking Documentation: certhash for webRTC? HOT 1
- Race Condition on opening a Stream over a DataChannel HOT 3
- ERR_ENCRYPTION_FAILED tryng to connect to go-ipfs HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-libp2p.