Comments (4)
我认为这应该是一个实现错误
Lines 315 to 318 in 19907a9
根据约定,这里应该返回 Ok(0)
Poll::Ready(Ok(())) means that data was immediately read and placed into the output buffer. The amount of data read can be determined by the increase in the length of the slice returned by ReadBuf::filled. If the difference is 0, EOF has been reached.
from tentacle.
或许可以在这里把状态切换到Closed
?
https://github.com/nervosnetwork/tentacle/blob/master/yamux/src/stream.rs#L180-L190
接受pr吗?我晚点可以试试修一下。
from tentacle.
看了下Spec和Go的实现,收到FIN后需要再发一个FIN回去,那应该在这里将Ok(0)
传播出poll_read
就行了。
Line 318 in 19907a9
from tentacle.
或许可以在这里把状态切换到Closed?
https://github.com/nervosnetwork/tentacle/blob/master/yamux/src/stream.rs#L180-L190
这个是错的,yamux 有半关状态,直接切换是不行的
接受pr吗?我晚点可以试试修一下。
当然接受,如果有兴趣的话可以尝试一下,需要带上一个测试用例,类似这个
Line 541 in 19907a9
看了下Spec和Go的实现,收到FIN后需要再发一个FIN回去,那应该在这里将Ok(0)传播出poll_read就行了。
对,修法很简单,将这个函数拆开,在 RemoteClosing 的分支直接返回 Poll(Ok(())
就可以了
from tentacle.
Related Issues (20)
- Do this library has a plan to implement certificate mechanism? HOT 1
- Support serialization format molecule
- What is the different from rust-libp2p HOT 2
- add QUIC transport HOT 1
- Multiaddr implementation is missing protocol
- An easy-to-use client mode HOT 8
- Fix all `let _ =` statement HOT 1
- about secio HOT 6
- [yamux] how to use the tokio-yamux when the client stream is created continually? HOT 2
- The stream is not closed when the underlying connection closed? HOT 3
- Are we support the wasm platform yet? HOT 1
- Bugs when setting the service timeout to 0 or a very large value HOT 3
- Handle the collection errors both reading and writing
- Unable to open protocol randomly, especially when the client only has limited CPU resources.
- 0.4 tentacle break proposal HOT 5
- yamux: can not work properly when server listening on a serial port inside VM, and client connet the serial port socket outside VM HOT 2
- tentacle add tls protocol HOT 2
- Should we use `std::hint::spin_loop` in cas loop HOT 1
- Tls reconnect error
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 tentacle.